Entry
I want to name a SELECT 'someSelect[]' for PHP, but I think the '[]' are illegal in JS. Help.
Aug 7th, 2002 05:56
Jenni Koskenpää, Ashish Chamoli, Alex Dean,
------------------
Just add
ID="ListBoxName"
to your existing listbox, after alteration which will look like :
Name="ListBoxName[]" ID="ListBoxName"
and thereafter it will solve the problem of different names for
JavaScript and PHP.
Take Care,
Ashish Chamoli
------------------
Above doesn't work with Netscape so I prefer naming your script like
below:
<select name="var[]" multiple>
And Javascript like:
variable = documents.forms[0].elements['var[]'];
See more help: http://www.php.net/manual/en/faq.html.php
-Jenni