Wrox Home  
Search P2P Archive for: Go

  Return to Index  

javascript thread: changing default button in html


Message #1 by "sara" <fillet70@h...> on Sat, 16 Nov 2002 03:55:47
I have 3 buttons on my form. How do i make one of them the default such 
that pressing the enter key corresponds to clicking this button ?
As of now, when i press the enter key the form gets submitted with the 
first button and i need my second button to be the default. I dont want to 
change the order of the buttons.

In another posting, somebody had suggested the usage of regular buttons 
instead of submit buttons. The click event of each button would call a 
Javascript function which would submit the form with the button clicked. 
The enter key in this case would not be mapped to any button.

Is there any other solution ?

  Return to Index