I have a form that the user needs to fill out with redundant data so I have created a dynamic drop down box to act as a time saver allowing the fields to propogate through the form once the proper ID is selected. The drop down works and when selected propogates the neccessary information but with a catch, here's the code...
simple right? when the appropriate drop down is selected the code elsewhere on the page <? echo's ?> the proper result. Now I fill in the rest of the information in the adjoining fields and hit submit.
<select size="1" name="phid" onChange="this.form.submit()">
// GET Pharmacy ID's by Territory
$query = "SELECT Ph_ID, Pharmacy_Name FROM pharmacies WHERE terr_ID='$SESSION_TERR_ID'";
$result = mysql_db_query($database, $query, $connection) or die ("Error in query: $query. " . mysql_error());
while (list($Ph_ID, $Pharmacy_Name) = mysql_fetch_row($result))
echo "<option value='$Ph_ID'>$Ph_ID</option>";
The submit() function overrides the <input> that is supposed to carry all the variables to the next page to be submitted to the database.
Is there another way to use the dropdown box and still use a submit button without them cancelling one another out?
I've attached the code for your viewing pleasure... All help would be appreciated