Re: Need Help Please

From: Date: Mon, 22 May 2006 04:11:13 +0000
Subject: Re: Need Help Please
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-236603@lists.php.net to get a copy of this message
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

« previous php.general (#236603) next »