Remembering input from dynamic drop down lists
Posted: Mon Dec 19, 2005 10:21 am
Hello,
I am trying to figure out how to make my form remember what was selected from a drop box when a user submits it but has to go back and correct their inputs.
Here is the code that I am using that needs to be remebered.
Here is some code for some "static" drop boxs I am using, it works good because the optional values are always the same. but in the dynamic list it is choosing any number of options from a list of over 2200 customer names.
I am trying to figure out how to make my form remember what was selected from a drop box when a user submits it but has to go back and correct their inputs.
Here is the code that I am using that needs to be remebered.
Code: Select all
<select name=location_name OnChange=document.workorderform.submit()><option> </option>";
while($row = mssql_fetch_array($results)) {
echo '<option value="'.$row[CustomerID].'">'.$row[CustomerName].'</option>';
}
echo "</select>";Here is some code for some "static" drop boxs I am using, it works good because the optional values are always the same. but in the dynamic list it is choosing any number of options from a list of over 2200 customer names.
Code: Select all
<?php echo '<select name="performed_by">';
echo "<option value='Service'"; if($performed_by == 'Service') echo " selected"; echo ">Service</option>";
echo "<option value='Operations'"; if($performed_by == 'Operations') echo " selected"; echo ">Operations</option>";
echo "<option value='Copier Administative'"; if($performed_by == 'Copier Administrative') echo " selected"; echo ">Copier Administrative</option>";
echo "<option value='Furniture Administrative'"; if($performed_by == 'Furniture Administrative') echo " selected"; echo ">Funiture Administative</option>";
echo "</select>";
?>