Hi everyone,
I hope someone can help me with this problem:
I have a form on page that looks like this:
<form method='post' action='b.php'>
<select name='subject[]' size='3' multiple='multiple'>
<option value='ALL'>Select All</option>
<option value='1'>Field 1</option>
<option value='2'>Field 2</option>
<option value='3'>Field 3</option>
<option value='4'>Field 4</option>
</select>
<input type='submit' name='Submit' value='Ok'>
</form>
As you see this form lets the user select multiple choices. I need to know how can I get the user selection with the POST method in my b.php file.
And also how to get the number of items selected.
Thanks in advance.
Working with select box
Moderator: General Moderators
- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
Code: Select all
$subjects = $_POST['subject'];
$num = sizeof($subjects;