Default Buttonwhen enter is used?

  • Thread starter Thread starter Ben de Vette
  • Start date Start date
B

Ben de Vette

Hi,

when I create a form in ASP.NET, how do I define the default Button which is
send with the form as being clicked on, when I press the enter.

I have three buttons,
Update, Delete and Cancel

Furthermore there are a number buttons defined as a menu.

When I press enter in the form, I want to have the Update button to be sent
with the Form, but now, the first menu button is being sent with the form as
being clicked.

Thanks,
Ben
 
I never found away around that....technically.

What I do is make Update a button and Cancel and Delete LinkButtons. That
way enter makes the update occur and the user will have to click the link
button to submit it.

--
Eric Marvets
Principal Consultant

the bang project

<shameless self promotion>

Email (e-mail address removed) for Information on Our Architecture and
Mentoring Services

</shameless self promotion>
 
When I first looked at this I recalled that it is possible to set a default
Enter button for a form.
Too bad what I recalled was for Windows forms, not Web forms! <g>

A Google search should reveal some of the issues as to why IE operates the
way it does with respect to submitting forms on Enter.

I was looking for a way to turn off the behavior.

I found a nice script for killing the Enter key and embedded it in my Base
page as a Property so I can automatically disable Enter on all pages except
those that I want it available on.
 
Back
Top