PDA

View Full Version : Focus control for users pressing Enter on button


soldatenhund
06-05-2008, 11:03 PM
Hello all,

We have two submit buttons but after a user fills in a textbox control we would like to ensure that when the user presses enter instead of clicking that the proper button is activated.

Currently, it does not and of course the button that is activated submits null values and gives an error message.


Any help would be appreciated.

Brandoe85
06-06-2008, 05:56 PM
check out the defaultButton property:
http://msdn.microsoft.com/en-us/library/system.web.ui.htmlcontrols.htmlform.defaultbutton.aspx

Good luck;