At 07:38 PM 5/21/2006, marvin hunkin wrote:
now, when i open the form, it does not set focus to the first form field which is the user name.
goes to the login button.
why is this?


Marvin,

Although someone else has suggested you use JavaScript to set the focus on a particular form field, I urge you instead to use HTML tabindex property:

<p>User Name: <input tabindex="1" type="text" name="username"> </p> <br>
<p>Password: <input tabindex="2" type="password" name="password"> </p> <br>
<p><input tabindex="3" type="submit" value="Login"> </p>

HTML 4.01 Specification
17 Forms
17.11 Giving focus to an element
17.11.1 Tabbing navigation
http://www.w3.org/TR/html4/interact/forms.html#h-17.11.1

Simplistic JavaScript solutions place focus on an input field after the page has completely loaded, often after the user has begun interacting with the form, causing irritating focus jumps in mid-input.

Regards,
Paul
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to