Page 1 of 1
How can i get the data in a select-option?
Posted: Thu Jun 26, 2008 12:42 am
by bulsecoip
hi, can someone help to solve this problem, i dont know how to get the data in select-option object? the code should get all the data in it.
thnx
Re: How can i get the data in a select-option?
Posted: Wed Jul 09, 2008 3:35 am
by sureshmaharana
Can u explain your problem in detail.
thanks.
Re: How can i get the data in a select-option?
Posted: Wed Jul 09, 2008 6:12 am
by Brunda
If its a dropdown list then
<select name="abc" />
<option value="pqr"> pqr </option>
<option value="pqr1"> pqr1 </option>
<option value="pqr2"> pqr2 </option>
</select>
if your form method is post then
$_POST['abc'] will give you the selected item in the list.
If its a multi select then
$_POST['abc'] will return an array which will contain all the selected values in the list.