How to control enter button on the client PC in ASP.Net

Discussion in 'ASP .Net' started by Simon Fainveits, Aug 11, 2003.

  1. Does anybody know how to control enter button on the web
    form? It seems to if the user hits enter button at run
    time then it fires submit button click event. I have also
    noticed that if the page does not have a submit button
    then the button that was first placed on the form at
    design time is fired and I do not want that to happen. Is
    there any way to control enter button behaviour?
    Many thanks
    Simon
    Simon Fainveits, Aug 11, 2003
    #1
    1. Advertising

  2. You can intercept the client side enter keypress event of the text box and
    then click the correct button 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 good article on the subject:
    http://www.allasp.net/enterkey.aspx

    --
    I hope this helps,
    Steve C. Orr, MCSD
    http://Steve.Orr.net


    "Simon Fainveits" <> wrote in message
    news:025401c35fab$740c5f00$...
    > Does anybody know how to control enter button on the web
    > form? It seems to if the user hits enter button at run
    > time then it fires submit button click event. I have also
    > noticed that if the page does not have a submit button
    > then the button that was first placed on the form at
    > design time is fired and I do not want that to happen. Is
    > there any way to control enter button behaviour?
    > Many thanks
    > Simon
    Steve C. Orr, MCSD, Aug 11, 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. TS
    Replies:
    5
    Views:
    14,435
    Jeffrey Tan[MSFT]
    Nov 29, 2005
  2. Sunfire
    Replies:
    2
    Views:
    1,041
    Sunfire
    Nov 6, 2007
  3. BrianDH

    Enter Key H*ll, control enter key submit button

    BrianDH, Jan 12, 2005, in forum: ASP .Net Web Controls
    Replies:
    3
    Views:
    345
    Anders Matthiessen
    Jan 12, 2005
  4. Matt
    Replies:
    1
    Views:
    482
    Michael Winter
    Mar 6, 2004
  5. HopfZ
    Replies:
    0
    Views:
    504
    HopfZ
    Aug 28, 2006
Loading...

Share This Page