...

View Full Version : capturing data from from a drop down of multiple attribute



bhakti_thakkar
12-23-2006, 11:00 AM
Hi all,
i have a dropdown whose data i fetch from DB.
<select name="mySelect" multiple size=1></select> the problem is, if the user has selected more than one value it prints me only one. i print it this way :
<?
print_r($_POST['mySelect']);
?>

i want to capture all the selected values. how will i do it??
Thanks

harsh789
12-23-2006, 02:00 PM
This is because each option will overwrite the contents of the previous mySelect variable.
You need to use PHP array here.
like,

<select name="mySelect[]" multiple size=1></select>



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum