Hi, I have two text field boxes; username and password. There is also a checkbox below the username field. Currently pressing the tab button on they keyboard results in the checkbox gaining focus, I would like to override this so that tab key would bring the password field into focus. Does anyone know how to do this using jQuery or how to restructure the HTML to achieve the same effect? Thanks
A:
<input type="text" name="user" tabindex=1 /><br />
<input type="password" name="password" tabindex=2 /><br />
RemberMe:<input type="checkbox" name="loggedIn" tabindex=3 /><br />
or
<input type="text" name="user" tabindex=1 />
RemberMe:<input type="checkbox" name="loggedIn" tabindex=3 /><br />
<input type="password" name="password" tabindex=2 /><br />
tab index is the attribute to shift focus when tab is clicked.
Praveen Prasad
2010-09-23 15:32:45
please provide your html if this doesnt work for you.
Praveen Prasad
2010-09-23 15:33:34
+1
A:
Use tabindex
<input type="text" name="user" tabindex=1 /><br />
RemberMe:<input type="checkbox" name="loggedIn" value=" " /><br />
<input type="password" name="password" tabindex=2 /><br />
Loïc Février
2010-09-23 15:34:25