I have a problem with html form elements names as assotiative arrays.
<form name="ff" action="" method="POST">
<input name="student[john]" value="John">
<input name="student[kofi]">
<input name="student[kwame]">
<input type="submit" name="submit">
</form>
<a onclick="alert(document.ff.student[john].value);">a<a>
I’m getting JS error: “Uncaught exception: ReferenceError: Undefined variable: john”
But this code works fine with form elements names without square brackets.
UPD:
I’m puzzled how to get values from radio elements (it represented as a group of radios with same names)
You’ll have to use square bracket notation to access a property with special characters
DEMO