Multiple select form: is it possible passing javascript variable to PHP?
| From: | Eager Ip | Date: | Fri, 04 Aug 2000 06:49:58 +0000 |
| Subject: | Multiple select form: is it possible passing javascript variable to PHP? | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-1773@lists.php.net to get a copy of this message | ||
Hi,
I have an html multiple select form and I would like to pass the selected
values into PHP variable and insert the values into MySQL. But when I submit
the values, I got something like:
name.php3?select_name=1&select_name=2&select_name=4
where select_name is the name of <select> and the 1, 2 and 4 is the <option>
values selected.
I know I can refer to the selected values using javascript
window.document.form_name.select_name.options[window.document.form_name.sele
ct_name.selectedIndex].value
but I don't know how to pass the value into PHP variable. Can these
javascript variables be passed into PHP or Is there way to work around it? I
know the problem can be solved if I use check boxes or radio buttons but I
must use <select multiple> in my website (the multiple select form is
generated by javascript menu swapper).
Thanks for any help!
Eager =:o3