0

in my jsp, when i navigate through tab key it skips my Save and Reset button. and move to next component in my page. even though i have not used tabindex in my jsp files. please suggest what could be the reason. thanks

code is like:

<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>
jmj
  • 237,923
  • 42
  • 401
  • 438
Raj
  • 75
  • 1
  • 9

2 Answers2

1

May be because it is not input type , you can explicitly try setting tabIndex

jmj
  • 237,923
  • 42
  • 401
  • 438
0

Try:

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

Note if it's a form you need input type="button" rather than just using <button> which you can otherwise just for straight links that don't submit a form. This is particularly relevant with Internet Explorer that treats the button tag somewhat differently to other browsers (submitting the "value=" rather than the enclosed text or something like that)

Michael Durrant
  • 93,410
  • 97
  • 333
  • 497
  • but when i am on this jsp. when i click Enter key the form was getting submitted regardless of component tab key focussing. pls suggest. – Raj Nov 18 '11 at 03:56