469,631 Members | 1,776 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,631 developers. It's quick & easy.

Default Buttonwhen enter is used?

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
Nov 18 '05 #1
3 1007
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 sa***@bangproject.com for Information on Our Architecture and
Mentoring Services

</shameless self promotion>
Nov 18 '05 #2
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.
--
Joe Fallon

"Eric Marvets" <er***@bangproject.com> wrote in message
news:uC**************@TK2MSFTNGP09.phx.gbl...
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 sa***@bangproject.com for Information on Our Architecture and
Mentoring Services

</shameless self promotion>

Nov 18 '05 #3
Check out this article,
http://www.allasp.net/enterkey.aspx

--
Saravana
Microsoft MVP - ASP.NET
www.extremeexperts.com

"Ben de Vette" <Be****************@profiler.nl> wrote in message
news:10*************@corp.supernews.com...
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

Nov 18 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by Chuck Bowling | last post: by
7 posts views Thread by Derrick | last post: by
21 posts views Thread by planetthoughtful | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.