View Full Version : Getting multiple values from List Box

09-07-2005, 08:23 AM

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


09-07-2005, 11:16 AM

<form action="file.php" method="post">
<select name="myselect[]" id="myselect" multiple="multiple">
<option value="option_1">Option 1</option>
<option value="option_2">Option 2</option>
<option value="option_3">Option 3</option>
<option value="option_4">Option 4</option>
<input type="submit" value="Submit" />

and the PHP:


$all_selected_values = '';
foreach($_POST['myselect'] as $value)
$all_selected_values .= $value."\r\n";


Does that help? :)

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum