Using PHP to get all items in a multi-select form field
| From: | Chuck dot Hirstius at walgreens dot com | Date: | Wed, 03 Jan 2001 17:00:22 +0000 |
| Subject: | Using PHP to get all items in a multi-select form field | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-32517@lists.php.net to get a copy of this message | ||
I am trying to a "SELECT" element in a form, and I am allowing multiple
selections. However when I try to retrieve the values PHP only returns the
last selected value. I found that adding "[]" to the end of my element's
name fixes the problem (PHP then gets an array) but I am using several
JavaScript functions to validate, and alter the selections. Adding the
brackets breaks all of the JavaScript. Can anyone give me a way to make
both of these work? To still be able to use JavaScript (ie have a normal
name) and yet get all of the selections from the box.
I am currently off list, so please respond to my email address. Thanks!
Chuck Hirstius