Question
Drop Down List Problem
Hello,
My application has an edit record page. This page contains a form with a table that has a combination of text boxes, text areas, and drop down lists. The drop down lists are bound to record sets that use look up tables. The problem pertains to the drop down lists. When the user opens the form, the previously entered values of the fields with drop down lists changes to whatever the first value in the drop down list is (in this case blank). Is there a way to modify my form so that the fields keep whatever values were made in the previous edit.
I'm using PHP with MySQL. Here's the code for one of the drop down fields [status] that is bound to the record set rsLUStatus :
=============================================
<tr>
<td>Status:</td>
<td><select name="status" id="status" title="<?php echo $row_rsLUstatus['LUStatus']; ?>">
<option value=""></option>
<?php
do {
?>
<option value="<?php echo $row_rsLUstatus['LUStatus']?>"><?php echo $row_rsLUstatus['LUStatus']?></option>
<?php
} while ($row_rsLUstatus = mysql_fetch_assoc($rsLUstatus));
$rows = mysql_num_rows($rsLUstatus);
if($rows > 0) {
mysql_data_seek($rsLUstatus, 0);
$row_rsLUstatus = mysql_fetch_assoc($rsLUstatus);
}
?>
</select></td>
</tr>
=============================
My application has an edit record page. This page contains a form with a table that has a combination of text boxes, text areas, and drop down lists. The drop down lists are bound to record sets that use look up tables. The problem pertains to the drop down lists. When the user opens the form, the previously entered values of the fields with drop down lists changes to whatever the first value in the drop down list is (in this case blank). Is there a way to modify my form so that the fields keep whatever values were made in the previous edit.
I'm using PHP with MySQL. Here's the code for one of the drop down fields [status] that is bound to the record set rsLUStatus :
=============================================
<tr>
<td>Status:</td>
<td><select name="status" id="status" title="<?php echo $row_rsLUstatus['LUStatus']; ?>">
<option value=""></option>
<?php
do {
?>
<option value="<?php echo $row_rsLUstatus['LUStatus']?>"><?php echo $row_rsLUstatus['LUStatus']?></option>
<?php
} while ($row_rsLUstatus = mysql_fetch_assoc($rsLUstatus));
$rows = mysql_num_rows($rsLUstatus);
if($rows > 0) {
mysql_data_seek($rsLUstatus, 0);
$row_rsLUstatus = mysql_fetch_assoc($rsLUstatus);
}
?>
</select></td>
</tr>
=============================
