Reselect Correct <Select> Option
Posted: Thu Oct 07, 2010 11:21 am
I have a drop down menu that displays the desired radius in miles for the user’s search. The form posts the data and then reloads the page. I want the drop down menu to continue showing the last distance that they selected. Currently I have the top option as “within” and the value as previously selected, but I would like it to just select the right spot of the drop down. Anyone know how to do this?
Code: Select all
<select name="radius" id="radius">
<OPTION VALUE="<?php echo $radius; ?>">within</Option>
<OPTION VALUE="1">1 Miles</Option>
<OPTION VALUE="2">5 Miles</Option>
<OPTION VALUE="3">10 Miles</Option>
<OPTION VALUE="4">25 Miles</Option>
<OPTION VALUE="5">50 Miles</Option>
</select>