Click to See Complete Forum and Search --> : Default submit button
Jorge22
July 8th, 2002, 12:09 PM
How can i make one button out of a few (on a web form), the default button when the user presses ENTER ?
1) Can this be done in the code behind ?
2) Can this be done in the HTML designer ?
Thanks in advance.
Shrish_Mishra
May 9th, 2004, 08:23 AM
Default submit button
I also have the same concern. How can i make one button out of a few (on a web form), the default button when the user presses ENTER ?
I tried by capturing the Enter key press event (13). But in that case it will always submit to the default button even if user focuses on some different button and then presses enter.
-Shrish
anupam kant
May 13th, 2004, 02:24 AM
The code
if(event.keyCode == 13)
{
//button.click function here;
event.keyCode=0;
event.returnValue=false;
event.cancelBubble=true;
}
should work.
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.