hitting "enter" on a page

  • Thread starter Thread starter MattB
  • Start date Start date
M

MattB

I have a WebForm that has a "reset" button and an "Enter" button. It's a
long form, and users tend to hit the enter key at some point when they
really want to tab to the next form field. How can I control this default
behavior? I figured I could have an "are you sure?" confirmation if fields
are blank, but I think I'd just rather make it so enter doesn't submit the
form.
Any examples or suggestions for me? Thanks!

Matt
 
Perfect. Thanks!

Matt
You can intercept the client side enter keypress event of the text
box and then do what you want using javascript code.
Here's a good example:
http://www.kamp-hansen.dk/pages/showdoc.asp?id=28&menuid=21&menuid=18

You could also try using this free control.
http://www.metabuilders.com/tools/DefaultButtons.aspx

And here's a couple good articles on the subject:
http://www.allasp.net/enterkey.aspx
http://www.aspnetpro.com/features/2004/06/asp200406so_f/asp200406so_f.asp
 
Back
Top