健全性检查 - 我在表单中有一个选择标签,但无法使用 Tab 键访问它。我已经明确设置了选项卡索引,但没有帮助
这实际上很尴尬,但我似乎无法点击选择框,而且我已经尝试了我所知道的一切。
<form action="trial.php" method="post">
<div class="formLeftCol">
First Name:<br/>
Last Name:<br/>
Address:<br/>
City:<br/>
Select State <br/>
Zip Code:<br/>
Phone:<br/><br/>
<p class="emailLabel">
Email:</p><br/>
</div>
<div class="formRightCol">
<input class="formInput" type="text" name="first" />
<input class="formInput" type="text" name="last" />
<input class="formInput" type="text" name="address" />
<input class="formInput" type="text" name="city" />
<select tabindex=1 class="formInput" name="state">
<option value="AL">Alabama</option>
<option value="AK">Alaska</option>
<option value="AZ">Arizona</option>
<option value="AR">Arkansas</option>
<option value="CA">California</option>
<option value="CO">Colorado</option>
<option value="CT">Connecticut</option>
<option value="DE">Delaware</option>
<option value="DC">District of Columbia</option>
<option value="FL">Florida</option>
<option value="GA">Georgia</option>
<option value="HI">Hawaii</option>
<option value="ID">Idaho</option>
<option value="IL">Illinois</option>
<option value="IN">Indiana</option>
<option value="IA">Iowa</option>
<option value="KS">Kansas</option>
<option value="KY">Kentucky</option>
<option value="LA">Louisiana</option>
<option value="ME">Maine</option>
<option value="MD">Maryland</option>
<option value="MA">Massachusetts</option>
<option value="MI">Michigan</option>
<option value="MN">Minnesota</option>
<option value="MS">Mississippi</option>
<option value="MO">Missouri</option>
<option value="MT">Montana</option>
<option value="NE">Nebraska</option>
<option value="NV">Nevada</option>
<option value="NH">New Hampshire</option>
<option value="NJ">New Jersey</option>
<option value="NM">New Mexico</option>
<option value="NY">New York</option>
<option value="NC">North Carolina</option>
<option value="ND">North Dakota</option>
<option value="OH">Ohio</option>
<option value="OK">Oklahoma</option>
<option value="OR">Oregon</option>
<option value="PA">Pennsylvania</option>
<option value="RI">Rhode Island</option>
<option value="SC">South Carolina</option>
<option value="SD">South Dakota</option>
<option value="TN">Tennessee</option>
<option value="TX">Texas</option>
<option value="UT">Utah</option>
<option value="VT">Vermont</option>
<option value="VA">Virginia</option>
<option value="WA">Washington</option>
<option value="WV">West Virginia</option>
<option value="WI">Wisconsin</option>
<option value="WY">Wyoming</option>
</select>
<input class="formInput" type="text" name="zip" />
<input class="formInput" type="text" name="phone" />
<input class="formInputEmail" type="text" name="email" />
</div>
<input class="formButton" type="image" src="images/trial/submitbutton.png" alt="Submit button">
</form>
This is actually embarrassing, but I can't seem to tab to the select box and I've tried all I know to do.
<form action="trial.php" method="post">
<div class="formLeftCol">
First Name:<br/>
Last Name:<br/>
Address:<br/>
City:<br/>
Select State <br/>
Zip Code:<br/>
Phone:<br/><br/>
<p class="emailLabel">
Email:</p><br/>
</div>
<div class="formRightCol">
<input class="formInput" type="text" name="first" />
<input class="formInput" type="text" name="last" />
<input class="formInput" type="text" name="address" />
<input class="formInput" type="text" name="city" />
<select tabindex=1 class="formInput" name="state">
<option value="AL">Alabama</option>
<option value="AK">Alaska</option>
<option value="AZ">Arizona</option>
<option value="AR">Arkansas</option>
<option value="CA">California</option>
<option value="CO">Colorado</option>
<option value="CT">Connecticut</option>
<option value="DE">Delaware</option>
<option value="DC">District of Columbia</option>
<option value="FL">Florida</option>
<option value="GA">Georgia</option>
<option value="HI">Hawaii</option>
<option value="ID">Idaho</option>
<option value="IL">Illinois</option>
<option value="IN">Indiana</option>
<option value="IA">Iowa</option>
<option value="KS">Kansas</option>
<option value="KY">Kentucky</option>
<option value="LA">Louisiana</option>
<option value="ME">Maine</option>
<option value="MD">Maryland</option>
<option value="MA">Massachusetts</option>
<option value="MI">Michigan</option>
<option value="MN">Minnesota</option>
<option value="MS">Mississippi</option>
<option value="MO">Missouri</option>
<option value="MT">Montana</option>
<option value="NE">Nebraska</option>
<option value="NV">Nevada</option>
<option value="NH">New Hampshire</option>
<option value="NJ">New Jersey</option>
<option value="NM">New Mexico</option>
<option value="NY">New York</option>
<option value="NC">North Carolina</option>
<option value="ND">North Dakota</option>
<option value="OH">Ohio</option>
<option value="OK">Oklahoma</option>
<option value="OR">Oregon</option>
<option value="PA">Pennsylvania</option>
<option value="RI">Rhode Island</option>
<option value="SC">South Carolina</option>
<option value="SD">South Dakota</option>
<option value="TN">Tennessee</option>
<option value="TX">Texas</option>
<option value="UT">Utah</option>
<option value="VT">Vermont</option>
<option value="VA">Virginia</option>
<option value="WA">Washington</option>
<option value="WV">West Virginia</option>
<option value="WI">Wisconsin</option>
<option value="WY">Wyoming</option>
</select>
<input class="formInput" type="text" name="zip" />
<input class="formInput" type="text" name="phone" />
<input class="formInputEmail" type="text" name="email" />
</div>
<input class="formButton" type="image" src="images/trial/submitbutton.png" alt="Submit button">
</form>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
要么只是从 select 元素中删除
tabindex
属性(因为其他输入元素没有该属性),或者也将其设置在所有其他输入元素上,并使用所需的值Tab 键顺序为tabindex
值。Either just remove the
tabindex
attribute from the select element (since other input elements doesn't have it), or set it on all other input elements as well, with the desired tabbing order astabindex
value.