With php you can use array[modifier] in form input names to pass an array with a form. I am trying to use this with some javascript that changes focus etc. on my form, but javascript won't let me use the array[modifier] method of identifying a select. ie:
<SCRIPT LANGUAGE="javascript">
<!--
function changeMenu(emp) {
emp.form.action[employee_number].options[0].text = "Something Else";
}
-->
</SCRIPT>
<FORM METHOD="post" ACTION="mypage.html">
<SELECT NAME="action[employee_number]"
onClick="changeMenu(this)"
onChange="changeMenu(this)">
<OPTION>Employee 1
<OPTION>Employee 2
<OPTION>Employee 3
</SELECT>
The javascript line "emp.form.action[employee_number].options[0]" etc. will not work because javascript doesn't like the [] in the variable name. Does anyone have a clue how to either get around that and let javascript use [] in the variable name, or to pass an array to php without using []?
Thanks!
Dale