[jQuery] Field Plug-in Update - TabIndex Navigation...
Everyone,
I've updated my Field Plug-in with some new methods to make it easy to go to
specific fields within the tabIndex of the form.
I'm looking for people to test the new functionality before updating my
Plug-in in the repository.
http://www.pengoworks.com/workshop/jquery/field.plugin.htm
Please check out the "Field Navigation Methods" under the "Interactive
Examples" section.
The "autoAdvance()" method may be the one that developers find the most
useful. However, from time-to-time I've needed to programmatically move to a
specific field and the move methods should be useful.
Here's an overview of the new methods:
$("#formName").autoAdvance();*
The autoAdvance() will search through the matching elements in the selector
for any text-based input fields. It will then apply an onkeyup event that
will take the user to the next field in the tabIndex (within the context of
the form) when the maxlength value of the field has been reached.
$("input[@name='users']").moveNext();*
This would move the focus to the next field in the tabIndex array from the
"users" field. If the next tabItem is outside of the form's context, the
first element in the form will be selected.
$("input[@name='users']").movePrev();*
This would move the focus to the previous field in the tabIndex array from
the "users" field. If the previous tabItem is outside of the form's context,
the last element in the form will be selected.
$("input[@name='users']").moveIndex(3);*
This would move the focus to the third element in the tabIndex array. If the
value "3" is outside the tabIndex array for the current form, then the last
field would be selected.
$("input[@name='users']").getTabIndex();*
This returns the tabIndex for the current field as it relates to the parent
form object.
* The tabIndex navigation methods attempt to follow the spec for tabbing
through elements. This means that elements that have a specified tabIndex
take priority over elements that do not specify an index. Disabled items are
skipped altogether.
-Dan