PRI.Kevin
PRI.Kevin

Reputation: 74

TAB button in HTML Form

http://www.mastersfunds.com.php5-23.dfw1-2.websitetestlink.com/how-to-invest

As seen in that form when I put my cursor in the FIRST NAME field and press TAB on my keyboard, the cursor goes to the right column dropdown instead of LAST NAME

How can I specify the order of the fields when a user uses the TAB button on my keyboard?

Upvotes: 1

Views: 1835

Answers (1)

user557846
user557846

Reputation:

specify tabindex in the input

eg

<html>
<head>
  <title>Controlling TAB Order</title>
</head>
<body>
  <form>
    Field 1 (first tab selection):
    <input type="text" name="field1" tabindex="1" /><br />
    Field 2 (third tab selection):
    <input type="text" name="field2" tabindex="3" /><br />
    Field 3 (second tab selection):
    <input type="text" name="field3" tabindex="2" /><br />
  </form>
</body>
</html>

EDIT: agree with comment, added quotes.

Upvotes: 7

Related Questions