Setting focus

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Don Grover

    Setting focus

    I have a form name cslogin and on this form is two textboxes userid &
    password and a submit button named login.
    How can I allow the user too type in userid or password and press enter key
    to login instead of needing to select submit button with mouse, I assume I
    have to set focus on submit button somehow.

    Don



  • Andrew Urquhart

    #2
    Re: Setting focus

    Don Grover wrote:[color=blue]
    > I have a form name cslogin and on this form is two textboxes userid &
    > password and a submit button named login.
    > How can I allow the user too type in userid or password and press
    > enter key to login instead of needing to select submit button with
    > mouse, I assume I have to set focus on submit button somehow.[/color]

    <form action="signin. asp" method="post">
    <fieldset>
    <legend>Pleas e Sign-In</legend>
    <label for="userid_1"> Username: </label>
    <input type="text" size="15" name="userid" id="userid_1" />
    <label for="pwd_1">Pas sword: </label>
    <input type="password" size="15" name="pwd" id="pwd_1" />
    <input type="submit" value="Sign in" />
    </fieldset>
    </form>

    Enter username and password, then press Enter (or equivalent). No script
    required, works in most browsers.
    --
    Andrew Urquhart
    - FAQ: http://jibbering.com/faq
    - Archive: http://groups.google.com/groups?grou...ang.javascript
    - Reply: https://www.andrewu.co.uk/about/cont...ject=Re%3A+clj


    Comment

    Working...