I have a cfselect used to select from a list of languages spoken thusly:

<cfselect name = "lang"
   required = "No"
   size = "5"
   multiple = "Yes"
   query = "getLANGUAGES"
   selected = "#request.langLIST#"
   value = "id_lang"
   display = "lang">
</cfselect>

Selecting anything and adding new records to the database, no problem. 
But, if updating a record and *deselecting* a language, no go. I'm doing 
this (cfquery param removed to make the code shorter for the example here):

<!---FIRST, DELETE THE PREVIOUS ASSOCIATIONS--->
<cfquery datasource="mydata">
DELETE FROM atty_lang
WHERE atty_id = '#form.atty_id#'
</cfquery>

<!---ADD THE NEW ASSOCIATIONS--->
<cfloop list="#form.lang#" index="i">
<cfset form.id_lang = #i# />
<cfinsert datasource="nmdata"
           tablename="atty_lang"
           formfields="atty_id,
           id_lang" >
</cfloop>
</cfoutput>
</cfif>

Let's say I've selected "GERMAN".
1. If I try to edit the record, and deselect "GERMAN", it will delete it 
in the code above, but then *reinserts* "German" again.
2. If I deselect "German", and select "French" instead, "German" is 
deleted and "French" is now selected.

So basically, I can't delete whatever was previously selected, I can 
only select something different.

What do I have wrong? If I deselect the previously entered value, it's 
still passing that value back to the query. If I pick a new value, it 
sends the new.

How do I get it to send "nothing selected"?

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;207172674;29440083;f

Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:317276
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

Reply via email to