hi, i need to do a dynamic select menu without using echo..
here is my code:
function makeYear($year)
{
$str = '<select name=\"drpDwnYr\" id=\"dropDwnYr\">
<option selected value="0">Year</option>';
for($i=1940;$i<2008;$i++) {
$str.='<option value="' . $i . '"';
//set selected value
if ($i == $year) {
$str.= 'selected = "selected"';
}
$str.= '>' . $i. '</option>';
}
$str.= "</select>";
return $str;
} //makeYear
to extract the value, i did this
$yr = $_POST['drpDwnYr'];
.. but i could not get the year selected.
pls help. tks