I'm not sure if this is a PHP question or an HTML question.
Short version: When the user selects an item from a list box, is there a way to make another list box on the same form immediately display the same value?
Long version: My page1.php collects user-specified data to build a query and pass the query to page2.php, which then displays the requested data in table format.
Some entry fields allow the user to specify a range. Two copies of a listbox containing the same values are listed for "FROM" and "TO" selections.
<select name="FROM1">
<option value="A">A</option>
<option value="B">B</option>
<option value="C">C</option>
<option value="D">D</option>
</select>
<select name="TO1">
<option value="A">A</option>
<option value="B">B</option>
<option value="C">C</option>
<option value="D">D</option>
</select>
Currently, if the user selects a FROM1 value only, the query searches for data >= FROM1. If only a TO1 value is selected, the query searches for data <= TO1. If both values are entered, the query searches for >=FROM1 AND <=TO1.
What I want to be able to do is save users a step if their intention is to search for a single item instead of a range of items. When a user selects "B" from FROM1, is it possible for TO1 to automatically default to a checked or selected value of "B", too?
Thanks!
Timm