Hi,
I have a one LIST BOX , in which a user has option to select multiple values. I want that if user select 3 values from LIST BOX, then my program print all these three values on the submission of the form
plz help me in in the code
bye
Getting multiple values from List Box
Moderator: General Moderators
- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
Code: Select all
<select name="multiselectbox[]" multiple="multiple">
.....
</select>the principle behind it: when php sees brackets in a form field name it creates an array. Using an empty (or always unique) value between the brackets will linearly store all fields passed under the parent name. To see what I mean, print_r($_POST['multiselectbox']) with several selections made..
(again, untested)