I have a select box that the user can change the value of:
$year=date("Y");
$years = array(1996,1997,1998,1999,2000,2001,2002);
echo "<SELECT name=goyear>";
for($y=0; $y<8; $y++)
{
if ($year==$years[$y])
{
echo $sel = ' selected';
}
else
{
$sel = '';
}
echo '<option value="'.$years[$y].'"'.$sel.'>'.$years[$y].'</option>';
}
echo "</SELECT>";
How do I capture what the value is if the user changes it?
For example: I have a query that returns results based on a default year. However, when the user selects a different date and selects a GO button I will requery the db for the appropriate results.
Struggling with how to capture the current value in the select box...
Appreciate the insight!!