default form button

  • Thread starter Thread starter Jason
  • Start date Start date
J

Jason

I know this is going to be a stupid question, but I'm in a crunch and don't
have time to research it as much as I'd like. How do you tell the web form
which button is the default button. So if a user fills out the form and
hits enter instead of clicking the submit button, the correct button gets
triggered.

In other words I have a web form with a cancel button and a submit button
and when I go into the form the and fill it out and hit enter the cancel
button is getting triggered and not the submit button.

Thanks in advance,

Jason
 
I believe the first button on the page will be what gets activated unless you set the focus to something else. This can all be a very tricky process.
 
No, only solution I can find is to make sure that the default button is
created first. Unfortenantely that is not always possible when creating
dynamic controls.

Jason
Alvin Bruney said:
Your post went unanswered. Have you resolved this issue?

--
Regards,
Alvin Bruney [ASP.NET MVP]
Got tidbits? Get it here...
http://tinyurl.com/3he3b
Jason said:
I know this is going to be a stupid question, but I'm in a crunch and don't
have time to research it as much as I'd like. How do you tell the web form
which button is the default button. So if a user fills out the form and
hits enter instead of clicking the submit button, the correct button gets
triggered.

In other words I have a web form with a cancel button and a submit button
and when I go into the form the and fill it out and hit enter the cancel
button is getting triggered and not the submit button.

Thanks in advance,

Jason
 
Back
Top