I have a html select list where one can chose an option.
<select name='price' id='price'>
<option value='' >Select....</option>
<option value='0-50,000'>0-50,000</option>
<option value='50,000-100,000'>50,000-100,000</option>
<option value='100,000-150,000'>100,000-150,000</option>
<option value='150,000-200,000'>150,000-200,000</option>
<option value='200,000 and above'>200,000 and above</option>
<option value='see all'>See All</option>
</select>
When this list is submitted via a html submit button, this list shows again in another page. Now, I want the option the user selected to be new selected value. I am doing this:
<select name='price' id='price'>
<option value='{$_POST['price']}'>{$_POST['price']}</option>
<option value='0-50,000'>0-50,000</option>
<option value='50,000-100,000'>50,000-100,000</option>
<option value='100,000-150,000'>100,000-150,000</option>
<option value='150,000-200,000'>150,000-200,000</option>
<option value='200,000 and above'>200,000 and above</option>
<option value='see all'>See All</option>
</select>
But values are appearing twice. The option the user selected is shown as the selected and still appears in the list. For example, we now have something like this:
0-50,000 (this is the selected value)
0-50,000
50,000-100,000
100,000-150,000
150,000-200,000
200,000 and above
How do I solve this?