how about this then
qDrop1 is the query holding the list for drop down one. myValues is the
query holding all the actual 'related' values
<select name="drop1">
<option value="">-- Select One --</option>
<cfoutput query="qDrop1">
<option value="#qDrop1.value#" <cfif myValues.drop1 EQ
qDrop1.value>selected</cfif> >#qDrop1.displayvalue#</option>
</cfoutput>
</select>
Doug
-----Original Message-----
From: Mark Drew [mailto:[EMAIL PROTECTED]
Sent: Saturday, August 14, 2004 5:32 AM
To: CF-Talk
Subject: Re: Update database with drop-down list
the way I do it is as follows
1. set up the value from the database as the defaults
e.g.
<cfparam name="FORM.dropdownlist1" default="#query.dropdownlist1#">
<cfparam name="FORM.dropdownlist2" default="#query.dropdownlist2#">
<cfparam name="FORM.dropdownlist3" default="#query.dropdownlist3#">
Now that you have the default FORM values.. lets display the form fields:
<select name="dropdownlist1">
<cfloop query="qry_getdropdownlistallvalues">
<cfset selected = "">
<cfif value EQ FORM.dropdownlist1>
<cfset selected = "selected">
</cfif>
<option value="#value#" #selected#>#name#</option>
</cfloop>
</select>
repeat for each of the drop downs
I hope this helps you on your way
Regards
Mark Drew
On Sat, 14 Aug 2004 02:16:56 -0700, Steve Sawyer
<[EMAIL PROTECTED]> wrote:
> I have six dynamic drop-down lists on an update form. I would like the
> lists to default to the current value in the database and allow for
updates.
> For example, if a user wishes to update lists #2 and #5, the lists would
> default to the current values for those fields and allow for changes. On
> submission the remaining 4 lists would retain their current values. Can
> anyone please point me to some documentation regarding this?
>
>
_____
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]

