Javascript and HTML hidden fields
OK, I have some hidden fields in my HTML document:
<input type="hidden" name="myField" value="1"/>
<input type="hidden" name="myField" value="2"/>
<input type="hidden" name="myField" value="3"/>
As you can see, they all have the same name, but different values. I am using servlets and JSP which allow you to use the request.getParameterValues("myField") methods, which return an array of strings.
However, I want to access these from a javascript function. So how do I do this? I've tried:
for(int i = 0; i < TheForm.myField.length; i++) document.write(TheForm.myField[i].value);
but this doesn't work.
Any ideas would be greatly appreciated.
HD