I have a form element that I want to address via javascript, but it doesn’t like the syntax.
<form name='mycache'> <input type='hidden' name='cache[m][2]'> <!-- ... --> </form>
I want to be able to say:
document.mycache.cache[m][2]
but obviously I need to indicate that cache[m][2] is the whole name, and not an array reference to cache. Can it be done?
UPDATE: Actually, I was wrong, you can use [ or ] characters as part of a form elements id and/or name attribute.
Here’s some code that proves it:
Update: You can also use the following to get the value from the form element: