[Javascript] Form with array like structure

Peter Lauri lists at dwsasia.com
Sun Jul 23 10:48:24 CDT 2006


Best groupmember,

I have a form that looks something like this:

<form>
<input type="text" name="thename[]"/>
<input type="text" name="thename[]"/>
<input type="text" name="thename[]"/>
</form>

In regular case, I can use document.getElementByName("thename").value to
check the value of it, but how do I do now when one name has several. In PHP
it is treated as an array, but how can I look thru this with JavaScript?

Best regards,
Peter Lauri




More information about the Javascript mailing list