Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Tabbing between form fields in javascript

Status
Not open for further replies.

avivit

Technical User
Jul 5, 2000
456
IL
I'd like to tab my form fields, in a loop, using:

function tabbing(field1, field2,field3,field4)
{ for (i=0;i<argumrntsNumber;i++)
{
document.form1[fieldName].tabIndex=i;
}
}

I'd like &quot;argumentsNumber&quot; to hold the number of arguments
that the function gets (field1, field2,field3), which can be changed of course,
so the loop will work for eavh field, until all list is tabbed.
(&quot;i&quot; is teh number of the tabIndex).
I need it for IE and ns6.
Thanks for any help.
 
Hi, i need to know if in the &quot;function tabbing(field1, field2,field3,field4)&quot; you especify the fields there or they are passed from a externall call
 
Vegeta, I call it from the body tag:
<body onload=&quot;tabbing('author',title','year')&quot;>

Anyway, I managed to do what I wanted now, so it's ok:

function tabbing(field1,field2,field3)
{var fieldName;
for (i=0;i<arguments.length;i++)
{fieldName=arguments;
document.form1[fieldName].tabIndex=i+1;
}
}

Thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top