How to change text field selection order when using tab key

梦想与她 提交于 2019-12-02 05:49:53

You have to number your tabindex in the order you'd like them to go.

<input type="text" name="name" id="name" value="" tabindex="1">
<input type="text" name="email" id="email" value="" tabindex="2">
<textarea cols="40" rows="8" name="message" id="message" tabindex="3"></textarea>
<input type="text" name="captcha" id="captcha" tabindex="4"/>
<input class="submit-button" type="submit" value="Submit" tabindex="5">

etc.

Right now you have two tabindexes set to 1, so they will go first, as they are the only ones with a defined tabindex.

Try utilizing the tabindex property for your input fields. This will let you control the order in which the user can tab through your page elements.

Example code for this can be found here, though you are already setting a tabindex on the name and email inputs. Just add that property to the rest of your inputs and set them in the order you would like.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!