Dan G. Switzer, II schrieb:
> Does anyone have code that will automatically advance the focus the next
> form element in the DOM and if it's the last form element, cycle to the
> first form field again?
>
Some untested code:
var elements = $($("#myform")[0].elements);
var pointer = 0;
function next() {
elements[pointer].focus();
if( ++pointer >= elements.length) pointer = 0;
}
Call next() everytime you want to focus the next form element.
--
Jörn Zaefferer
http://bassistance.de
_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/