Disabling default button behavior

  • Thread starter Thread starter Stephen Walch
  • Start date Start date
S

Stephen Walch

If a user is viewing an ASP.NET page in the browser and presses Enter, the
first button the page is "pushed" even if not selected. We are finding the
novice users are pressing Enter (thinking it will bring them to the next
field) and getting very confused. Advancing to the next field would be
nice, but I would settle for doing nothing.

Is there a way to disable this behavior? I suppose I could override the
"onkeydown" event in JavaScript for every single field. Is there any better
solution?
 
better is relative, this is probably the solution with the least pain
eventkey code = 13 for enter if i remember correctly
 
Back
Top