If I want to have arrays in a form I do something like this: <input type='hidden' name='myName' value='something'/> <input type='hidden' name='myName' value='something'/> PHP: So I can get the value of tags by document.formName.myName[0].value. But since I need to read the data through php after submitting the form I have to change it to name='myName[]'. Question: how do I get the value of myName now? This time document.formName.myName[0].value wouldn't work.
document.formName.elements["myName[]"] returns the array. each element can then be accessed as usual. e.g.: document.formName.elements["myName[]"][0].value