Hi all,

Sorry for the stupid post today but I cannot think.

I have an input field on a form:
<input type="checkbox" name="hotlead" value="<cfoutput>#SID#</cfoutput>">
(SID is the primary key in the SQL 2K DB).

then on the page:
<cfloop query="GetInfo">
    <tr>
        <td><input type="checkbox" name="hotlead"
value="<cfoutput>#SID#</cfoutput>" <cfif Hot EQ 1>checked</cfif></td>
    </tr>
</cfloop>

So here is my problem. When a checkbox (or more) is checked, I do this SQL
statement:
UPDATE survey SET Hot = 1 WHERE SID IN (10,17) and this works great.
However, if I deselect the checkbox I no longer have the SID:
UPDATE survey SET Hot = 1 WHERE SID IN 0 (makes sense the value is the SID).

So how do I do this?
I want to set the Hot field to 1 on only the SID when checked and if i
deselect it, then i want the field to be set to 0 on the SID i deselect. The
default value in the Hot (bit) field is 0.

Thanks,
Tony

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Your ad could be here. Monies from ads go to support these lists and provide more 
resources for the community. http://www.fusionauthority.com/ads.cfm

Reply via email to