浏览Tab键无法正常工作

时间:2011-11-17 11:50:25

标签: java html jsp

在我的jsp中,当我浏览tab键时,它会跳过我的Save and Reset按钮。并移至我页面中的下一个组件。即使我没有在我的jsp文件中使用 tabindex 。请说明可能是什么原因。感谢

代码就像:

<div>
<input type="hidden" name="_flowExecutionKey" value="${flowExecutionKey}"/>
<input type="submit" class="button" name="_eventId_search" value="Search"/>
<span class="save_button_common" onClick="submitForm('save')">Save</span>
<span class="reset_button_common" onClick="submitForm('reset')">Reset</span>

</div>

2 个答案:

答案 0 :(得分:1)

可能是因为它不是input type,您可以明确尝试设置tabIndex

答案 1 :(得分:0)

尝试:

<div>
<input type="hidden" name="_flowExecutionKey" value="${flowExecutionKey}"/>
<input type="submit" class="button" name="_eventId_search" value="Search"/>
<input type="button" class="save_button_common" onClick="submitForm('save')">Save</input>
<input type="button" class="reset_button_common" onClick="submitForm('reset')">Reset></input>
</div>

请注意,如果它是一个表单,您需要输入type =“button”而不是仅使用<button>,否则您只能用于不提交表单的直接链接。这与Internet Explorer特别相关,它将按钮标记与其他浏览器略有不同(提交“value =”而不是附带的文本或类似内容)