Square Brackets in Form Names
Hi there Java ppl,
I'm quite an experienced PHP developer, but very new to Java. And iv got a prb thats been a big headache:
I'm using square brackets to name my (PHP-generated) form elements so that they form an array. ie.
<SELECT name='info[$x]'><option>...etc
Now I want to write some Java whereby you can click a button and the select boxes change their selected value. But when I name elements with the square brackets I can't refer to them!
I've tried:
document.forms[0].info[selectBox].selectedIndex = 0; as well as:
document.forms[0].elements[0].selectedIndex = 0;
Nothing works! Please help me, I cant sleep when iv got a coding problem!
|