Ok you are running <cfupdate> which, if you don't specify, will be using all
form fields to update the db.

CFUPDATE-FORMFIELDS
Optional. A comma-separated list of form fields to update. If this attribute
is not specified, all fields in the form are included in the operation.

Now I'm not sure if you are looking to make it mandatory for the user to
update that field, if you are, then yes setting an <option> tag like I said
below will work if you add scripting (javascript or whatever) to check
onSubmit to ensure the value of that field is not blank.  You can also use
<cfselect> and the REQUIRED attrib.

If, however, you are looking to have the field optional, then you will need
to do a little logic on your action page.

If the value of the form field from the dropdown is unchanged,

        write your <cfupdate with only those FORMFIELDS that have changed>

elseif (some logic here),

        write your <cfupdate according to your logic>

else

        <cfupdate>

I think you get the idea from here.



Steven Semrau
SRA International, Inc.
Senior Member, Professional Staff
[EMAIL PROTECTED]
[EMAIL PROTECTED]
Com:  (703) 805-1095
DSN:  (703) 655-1095


-----Original Message-----
From: Marc Garrett [mailto:[EMAIL PROTECTED]]
Sent: Monday, April 23, 2001 5:59 PM
To: CF-Talk
Subject: Re: problem with list box update


Thanks for your help Steven. Unless I misunderstand you, your code makes
more sense for an insert page than an update page. What I want to do is
populate the dropdown list on the update page with the value from the
database. If the user updates other fields of the record but doesn't want
the category to change my code doesn't work.

Any other suggestions?

Regards,

Marc Garrett

----- Original Message -----
From: "Semrau, Steven L Mr SRA" <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Monday, April 23, 2001 4:42 PM
Subject: RE: problem with list box update


> Make your first selection blank <option value="" selected></option>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to