473,396 Members | 1,714 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

enter key hell problem 1

Hi
here is the situation
I have a login page with 2 user control
one for login one for registering new members

i want to be able to press enter to submit the form to the proper
submit button based on filled fields

the thing is there is no __EVENTTARGET
even if is register one as

Page.RegisterHiddenField("__EVENTTARGET", "Login1_btnSubmit");

it doesn't fire

what am i doing wrong ???
Nov 18 '05 #1
2 867
You can intercept the client side enter keypress event of the text box and
then do what you want using javascript code.
Here's a good example:
http://www.kamp-hansen.dk/pages/show...d=21&menuid=18

You could also try using this free control.
http://www.metabuilders.com/tools/DefaultButtons.aspx

And here's a couple good articles on the subject:
http://www.allasp.net/enterkey.aspx
http://www.aspnetpro.com/features/20...200406so_f.asp

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net
"gh0st54" <gh*****@hotmail.com> wrote in message
news:7f**************************@posting.google.c om...
Hi
here is the situation
I have a login page with 2 user control
one for login one for registering new members

i want to be able to press enter to submit the form to the proper
submit button based on filled fields

the thing is there is no __EVENTTARGET
even if is register one as

Page.RegisterHiddenField("__EVENTTARGET", "Login1_btnSubmit");

it doesn't fire

what am i doing wrong ???

Nov 18 '05 #2
thanks for the reply but i had seen those earlier here are my scripts
on the page

but then i have to verify the EVENTTARGET value on reply, i don't
want to do that

what i was looking for is why won't my __EVENTTARGET fire with my
default value set in code ???
function document.onkeydown()
{

if(event.keyCode ==13){
event.returnvalue=false;
event.cancel =true;

var theform;
if (window.navigator.appName.toLowerCase().indexOf("n etscape")
-1) {

theform = document.forms["Form1"];
}
else {
theform = document.Form1;
}
theform.submit();
}
}

function SetTarget(targetvalue){
var theform;
if (window.navigator.appName.toLowerCase().indexOf("n etscape") >
-1) {
theform = document.forms["Form1"];
}
else {
theform = document.Form1;
}
theform.__EVENTTARGET.value = targetvalue;
}
Nov 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Alan Zhong | last post by:
i am trying to similate an "ENTER" as a key to switch focus in a sequence of text inputs. i don't want to use "event.keyCode" since i want to do additional testing before i decide which text input...
22
by: Jim Hubbard | last post by:
I am reposting a portion of a thread that I am involved in under a new topic because it seems that there are still people that believe the whole "DLL Hell" myth. I hope I can shed some light on...
2
by: Nad | last post by:
Hello, dll hell has been eliminated in .NET using assembly versioning. I am new in .NET and would like to know if there is any dll-hell-equivalent in .NET Windows or Web development...
1
by: GreatB | last post by:
Bill Gates died in a car accident. He found himself in Purgatory being sized up by God . .. "Well, Bill, I'm really confused on this call. I'm not sure whether to send you to Heaven or Hell....
7
by: gh0st54 | last post by:
Hi me again problem 2 on pages that have no user controls i want to submit using the enter key i register Page.RegisterHiddenField("__EVENTTARGET", "btnSubmit"); when i press enter it...
11
by: Claudie Bouzy | last post by:
How do I set the enter key to move from one field to the next field?
18
by: Dave Sauny | last post by:
Ok, its a friday, I'm at work and I cant get this to work: I have 3 listboxes on one tab control page. when i select an item in listbox1 i want whatever is selected on the other 2 listboxes...
2
by: Scott M. | last post by:
I need a little help please... I'm simply trying to set up a very basic event for a class and then create an event handler for that class in a Console application. I think I'm very close, but...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.