User Controls with Form fields & Multiple Submits

Discussion in 'ASP .Net' started by =?Utf-8?B?QWxleCBNYWdoZW4=?=, May 7, 2006.

  1. Let's say I have a page which contains a bunch of text boxes and a Button.
    Then, also on the same page, I have a User Control I've created which has two
    text boxes and a button of its own.

    Here's my problem: In this case, when someone's typing in the textboxes on
    the page itself and they press the ENTER key, OR if they're typing in the
    text boxes of the UserControl and they press the ENTER key, how do I make
    sure that the proper submit button receives the click?

    In old fashioned HTML, this was done by creating multipple FORMs on a page
    and then the browser handled it. In ASP.NET I really don't know what to do.
    Do I have to right client-side JavaScript? If so, what do I have to do? Do I
    have to create a JS function for each time an onfocus occurs on every text
    box of the page? If so, what would that JS do? Or is there a property of the
    TextBox object which allows you to automatically define the default "Button"
    it pushes if the user hits enter?

    Confused.

    Alex
     
    =?Utf-8?B?QWxleCBNYWdoZW4=?=, May 7, 2006
    #1
    1. Advertising

  2. =?Utf-8?B?QWxleCBNYWdoZW4=?=

    V Guest

    V, May 7, 2006
    #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. Maurice LING
    Replies:
    2
    Views:
    1,116
    Maurice LING
    Mar 18, 2008
  2. TS

    Validation controls validate before form submits

    TS, Jun 24, 2005, in forum: ASP .Net Web Controls
    Replies:
    5
    Views:
    217
  3. Kuntal Joisher

    multiple form submits happening on window close

    Kuntal Joisher, Sep 6, 2003, in forum: Javascript
    Replies:
    0
    Views:
    142
    Kuntal Joisher
    Sep 6, 2003
  4. Matthew Sims
    Replies:
    0
    Views:
    144
    Matthew Sims
    Mar 4, 2004
  5. jpf
    Replies:
    0
    Views:
    104
Loading...

Share This Page