sowjanya
11-15-2007, 07:56 PM
Hi All,
I have a form with the input names as an array, i.e. the names of the form text boxes are input[0],input[1],input[2]....
When I use the following i can get a single value
form.elements['input[1]'].value
I want all the values into the java script. I tried the code here and is not working. can you please tell me why?
for(var i=0;i<=val1;i++)
{
val2='input['+i+']';alert(val2);
alert(form.elements[val2].value)
}
I have to validate the user not entering the values into input[1] if input[0] is null and so on, but how do I get the all the values into the javascript. Please help me out.
Thanks,
Sowjanya.
I have a form with the input names as an array, i.e. the names of the form text boxes are input[0],input[1],input[2]....
When I use the following i can get a single value
form.elements['input[1]'].value
I want all the values into the java script. I tried the code here and is not working. can you please tell me why?
for(var i=0;i<=val1;i++)
{
val2='input['+i+']';alert(val2);
alert(form.elements[val2].value)
}
I have to validate the user not entering the values into input[1] if input[0] is null and so on, but how do I get the all the values into the javascript. Please help me out.
Thanks,
Sowjanya.