Skip to main content
Participating Frequently
January 24, 2008
Question

Drop Down List Problem

  • January 24, 2008
  • 1 reply
  • 211 views
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>

=============================
This topic has been closed for replies.

1 reply

Inspiring
January 24, 2008
WPW07 wrote:
> Is there a way to modify
> my form so that the fields keep whatever values were made in the previous edit.

Select the drop-down menu in Design view, and click the Dynamic button
in the Property inspector. Click the lightning bolt icon alongside the
Select value equal to field, and select the value from your recordset.

--
David Powers, Adobe Community Expert
Author, "The Essential Guide to Dreamweaver CS3" (friends of ED)
Author, "PHP Solutions" (friends of ED)
http://foundationphp.com/
WPW07Author
Participating Frequently
January 24, 2008
Thanks David. That worked perfectly!

William