Submitting the form correctly using the enter key

Discussion in 'ASP .Net' started by thechaosengine, Jan 10, 2005.

  1. Hi all,

    Simple problem:

    I have a simple form and a submit and cancel image button underneath.

    I also have a logout image button at the top of the page. This button is
    rendered from a user control that is seperate from the form page itself.

    At the moment if I press enter when inside a textbox the log out button is
    activated. How can I make sure that the submit button is activated when the
    user presses enter?

    Many thanks all

    Kind Regards
    thechaosengine, Jan 10, 2005
    #1
    1. Advertising

  2. Enter activates the first submit button in the layout. See details at
    http://www.allasp.net/enterkey.aspx

    Can you place the logout button after the submit one?

    Eliyahu

    "thechaosengine" <sh856531@microsofts_free_email_service.com> wrote in
    message news:O5N%...
    > Hi all,
    >
    > Simple problem:
    >
    > I have a simple form and a submit and cancel image button underneath.
    >
    > I also have a logout image button at the top of the page. This button is
    > rendered from a user control that is seperate from the form page itself.
    >
    > At the moment if I press enter when inside a textbox the log out button is
    > activated. How can I make sure that the submit button is activated when

    the
    > user presses enter?
    >
    > Many thanks all
    >
    > Kind Regards
    >
    >
    Eliyahu Goldin, Jan 10, 2005
    #2
    1. Advertising

  3. thechaosengine

    Riki Guest

    thechaosengine wrote:
    > Hi all,
    >
    > Simple problem:
    >
    > I have a simple form and a submit and cancel image button underneath.
    >
    > I also have a logout image button at the top of the page. This button
    > is rendered from a user control that is seperate from the form page
    > itself.
    >
    > At the moment if I press enter when inside a textbox the log out
    > button is activated. How can I make sure that the submit button is
    > activated when the user presses enter?
    >
    > Many thanks all
    >
    > Kind Regards


    You can capture the Enter key with JavaScript
    to get the behavior you want:
    http://dotnetjunkies.com/WebLog/darrell.norton/archive/2004/03/03/8374.aspx

    --

    Riki
    Riki, Jan 10, 2005
    #3
    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. Phil
    Replies:
    2
    Views:
    5,043
  2. BrianDH

    Enter Key H*ll, control enter key submit button

    BrianDH, Jan 12, 2005, in forum: ASP .Net Web Controls
    Replies:
    3
    Views:
    370
    Anders Matthiessen
    Jan 12, 2005
  3. Veronica Bourke

    C# .NET stop carriage return/enter key submitting the form

    Veronica Bourke, Feb 16, 2005, in forum: ASP .Net Web Controls
    Replies:
    3
    Views:
    1,148
    Veronica Bourke
    Feb 16, 2005
  4. M P
    Replies:
    1
    Views:
    454
  5. donpro
    Replies:
    2
    Views:
    101
    Bart Van der Donck
    Nov 9, 2007
Loading...

Share This Page