I'm trying to re-assign a new tab-index on a given form. To do this I want to exclude any form elements that are invisible (not visible) -- and also exclude any form elements that possess a specific class (".offscreen").
I'm trying this method -- but, it's not working (and is perhaps not the most efficient method).
function reassignTabOrders() {
var tabindex = 1;
$j('input,select,textarea').not('.offscreen').each(function() {
var $input = $j(this);
if ($input.is(':visible')) {
$input.attr("tabindex", tabindex);
tabindex++;
}
});
};
Any ideas?