Default Buttonwhen enter is used?

Discussion in 'ASP .Net' started by Ben de Vette, May 23, 2004.

  1. Ben de Vette

    Ben de Vette Guest

    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
     
    Ben de Vette, May 23, 2004
    #1
    1. Advertising

  2. Ben de Vette

    Eric Marvets Guest

    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 for Information on Our Architecture and
    Mentoring Services

    </shameless self promotion>
     
    Eric Marvets, May 23, 2004
    #2
    1. Advertising

  3. Ben de Vette

    Joe Fallon Guest

    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" <> wrote in message
    news:...
    > 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 for Information on Our Architecture and
    > Mentoring Services
    >
    > </shameless self promotion>
    >
    >
     
    Joe Fallon, May 24, 2004
    #3
  4. Check out this article,
    http://www.allasp.net/enterkey.aspx

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



    "Ben de Vette" <> wrote in message
    news:...
    > 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
    >
    >
     
    Saravana [MVP], May 24, 2004
    #4
    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. =?Utf-8?B?am9l?=
    Replies:
    0
    Views:
    736
    =?Utf-8?B?am9l?=
    Sep 28, 2006
  2. Sunfire
    Replies:
    2
    Views:
    1,063
    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:
    401
    Anders Matthiessen
    Jan 12, 2005
  4. Matt
    Replies:
    1
    Views:
    510
    Michael Winter
    Mar 6, 2004
  5. HopfZ
    Replies:
    0
    Views:
    576
    HopfZ
    Aug 28, 2006
Loading...

Share This Page