How to make a specific 'submit' button the default?

Discussion in 'HTML' started by Martin, Jul 7, 2004.

  1. Martin

    Martin Guest

    I have a page/form with several text boxes and several submit buttons.
    I would like to have a script that would set one of the buttons as the
    'default' when the text in any of several specific text boxes is
    changed by the user. 'Default' meaning that's the one that will react
    when the user hits the <Enter> key.

    I read a message on another board that setting a submit button as the
    default is not possible - is that true?
    Martin, Jul 7, 2004
    #1
    1. Advertising

  2. Martin <> wrote:

    > I have a page/form with several text boxes and several submit buttons.
    > I would like to have a script that would set one of the buttons as the
    > 'default' when the text in any of several specific text boxes is
    > changed by the user.


    How would that help, given the fact that scripting can be disabled, and
    often is?

    The only safe way to avoid the problems caused by browsers' foolish
    behavior in this respect is to use only one submit button if you have
    text input fields in a form. Use e.g. radio buttons to let the user make
    the selection between the alternatives that the multiple submit buttons
    represent in your current design. That is, the user would just select an
    action by selecting among radio buttons, then use the single submit
    button to submit the form.

    --
    Yucca, http://www.cs.tut.fi/~jkorpela/
    Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html
    Jukka K. Korpela, Jul 7, 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. Mad Scientist Jr

    tie validator to a specific submit button ?

    Mad Scientist Jr, Aug 31, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    585
    Peter Blum
    Aug 31, 2004
  2. Mark
    Replies:
    1
    Views:
    1,687
  3. Ghafran Abbas
    Replies:
    0
    Views:
    4,207
    Ghafran Abbas
    Oct 12, 2004
  4. Andrew Crowe
    Replies:
    2
    Views:
    16,270
    Jukka K. Korpela
    Feb 6, 2004
  5. Mad Scientist Jr

    tie validator to a specific submit button ?

    Mad Scientist Jr, Aug 31, 2004, in forum: ASP .Net Web Controls
    Replies:
    1
    Views:
    197
    Teemu Keiski
    Sep 4, 2004
Loading...

Share This Page