yaron
09-16-2003, 03:35 AM
Hello all (first time here),
I have a form with an unknown number of fields.
the name of each filed is: fixed name + number
e.g. field1,field2,field3.....field189....
When a submit commant is taking place I call to a javascript function that needs to go through all of these fields.
I use a loop and on each iteration of the loop I change the filed name like this:
for(i=0;i<num;i++)
{
ifiled=field+i;
if(form.ifield.value='')
//do something
}
the field variable is sent to the javascript function.
When I write form.ifield.value I get the error that it is not an object though the variable ifield contains the correct field name!!
How can I use variables to go through my fields?
I hope my problem is understood
Thanks
I have a form with an unknown number of fields.
the name of each filed is: fixed name + number
e.g. field1,field2,field3.....field189....
When a submit commant is taking place I call to a javascript function that needs to go through all of these fields.
I use a loop and on each iteration of the loop I change the filed name like this:
for(i=0;i<num;i++)
{
ifiled=field+i;
if(form.ifield.value='')
//do something
}
the field variable is sent to the javascript function.
When I write form.ifield.value I get the error that it is not an object though the variable ifield contains the correct field name!!
How can I use variables to go through my fields?
I hope my problem is understood
Thanks