Default Buttonwhen enter is used?

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
 
E

Eric Marvets

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>
 
J

Joe Fallon

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top