One of the issues in the applications having forms is making them work without using the mouse. Thus, it might be required to make it possible for the user to tab in a certain sequence between the form’s elements.
The tabindex property is very useful to this purpose and is supported by both Firefox and IE.
The problem gets a little bit more complicated when dealing with conditional fields, i.e. if a one or more of them gets enabled/disabled depending on a radio button. In this case the tabbing sequence has to change accordingly.
- Use tabindex=’0′ to make an element being skipped to tabbing in all the browsers
- When setting the tabindex attribute, use ‘tabIndex’ instead of ‘tabindex’. For example jQuery(field).attr(“tabIndex”, 6);
- If there’s a need to preserve the last value of the tabindex with the goal of being restored, one may use something like jQuery(field).attr(“oldTabIndex”, 6). It works.