2011-11-17 23 views
0

,當我通過Tab鍵導航它跳過我保存和重置按鈕。並轉到我的頁面中的下一個組件。即使我沒有在我的JSP文件中使用的tabindex。請提出可能的原因。感謝通過tab鍵導航不工作在我的jsp正確

代碼如下:

<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> 

回答

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> 

注意,如果您需要一種形式輸入類型=「按鈕」,而不是僅僅使用<button>,否則您可以僅用於不提交表單的直接鏈接。這是Internet Explorer中有所對待按鈕標籤不同於其他瀏覽器尤其重要(提交「值=」,而不是封閉的文字或類似的東西)

+0

感謝,邁克爾·達蘭特對您有所幫助。它適用於我的問題.. – Raj

+0

但當我在這個jsp上。當我點擊回車鍵時,無論組件標籤鍵聚焦如何提交表單。請提出建議。 – Raj

1

可能是因爲它不是input type,你可以明確地嘗試設置tabIndex

+0

可以使用Tab鍵集中的元素是''和''。 – AlexR

+0

@AlexR檢查[這](http://stackoverflow.com/questions/1599660/which-html-elements-can-receive-focus) –

+0

謝謝您Jigar輸入 – Raj