Disabling default button behavior

Discussion in 'ASP .Net' started by Stephen Walch, Nov 3, 2003.

  1. 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?
     
    Stephen Walch, Nov 3, 2003
    #1
    1. Advertising

  2. Stephen Walch

    Alvin Bruney Guest

    better is relative, this is probably the solution with the least pain
    eventkey code = 13 for enter if i remember correctly

    --


    -----------
    Got TidBits?
    Get it here: www.networkip.net/tidbits
    "Stephen Walch" <> wrote in message
    news:ePK0D#...
    > 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?
    >
    >
     
    Alvin Bruney, Nov 3, 2003
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Paul
    Replies:
    4
    Views:
    372
    Hristo Ivanov [MS]
    Aug 1, 2003
  2. Lamine Darbouche
    Replies:
    1
    Views:
    476
    Johannes Hammersen
    Jun 29, 2005
  3. Mossman
    Replies:
    0
    Views:
    791
    Mossman
    Dec 12, 2005
  4. John Latter
    Replies:
    4
    Views:
    485
    John Latter
    Sep 9, 2003
  5. Replies:
    2
    Views:
    777
    Jonathan N. Little
    May 15, 2008
Loading...

Share This Page