controlling "return key" behavior with multiple "form-elements"

Discussion in 'ASP .Net' started by Holger (David) Wagner, Aug 17, 2004.

  1. Hi there,

    we have an application which is built with several ASCX controls some of
    which contain form elements (e.g. Textboxes, Buttons etc.)

    For example: in the top section (one ascx-control), there is a
    textbutton in which the user can enter a string to search for. There's
    link button right next to that textbutton. Then, in the "content
    section" (another ascx-control), there may be a login-dialog which
    prompts the user for login-name and password, with another button "Login".

    How can we make sure that when the user has entered his login data and
    enters "return" (instead of clicking the button), the event handler of
    the button is fired instead of firing the event handler of the
    search-button? And vice versa: when the user has entered a search string
    in the search-textbox and enters "return", how can we make sure this
    "search-button" event handler is fired instead of any other "subforms"
    event handler.

    We cannot have multiple forms as only one form is allowed per ASPX page
    (even when distributed among severy ascx-controls).

    kind regards,
    david
    Holger (David) Wagner, Aug 17, 2004
    #1
    1. Advertising

  2. Holger (David) Wagner

    Karl Guest

    This might be helpful:
    http://www.allasp.net/enterkey.aspx

    Karl

    "Holger (David) Wagner" <> wrote in message
    news:cftiqh$4hr$-online.net...
    > Hi there,
    >
    > we have an application which is built with several ASCX controls some of
    > which contain form elements (e.g. Textboxes, Buttons etc.)
    >
    > For example: in the top section (one ascx-control), there is a
    > textbutton in which the user can enter a string to search for. There's
    > link button right next to that textbutton. Then, in the "content
    > section" (another ascx-control), there may be a login-dialog which
    > prompts the user for login-name and password, with another button "Login".
    >
    > How can we make sure that when the user has entered his login data and
    > enters "return" (instead of clicking the button), the event handler of
    > the button is fired instead of firing the event handler of the
    > search-button? And vice versa: when the user has entered a search string
    > in the search-textbox and enters "return", how can we make sure this
    > "search-button" event handler is fired instead of any other "subforms"
    > event handler.
    >
    > We cannot have multiple forms as only one form is allowed per ASPX page
    > (even when distributed among severy ascx-controls).
    >
    > kind regards,
    > david
    Karl, Aug 17, 2004
    #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. Gregory Lielens
    Replies:
    0
    Views:
    488
    Gregory Lielens
    May 13, 2004
  2. M P
    Replies:
    1
    Views:
    454
  3. Amir Hardon
    Replies:
    1
    Views:
    77
    Amir Hardon
    Feb 28, 2004
  4. PerlFAQ Server
    Replies:
    0
    Views:
    140
    PerlFAQ Server
    Jan 24, 2011
  5. PerlFAQ Server
    Replies:
    0
    Views:
    112
    PerlFAQ Server
    Feb 20, 2011
Loading...

Share This Page