If I understand what you are trying to do... maybe this will work...  Kristi


The value of a checkbox is fixed.  The variable is whether or not it gets
checked.

<tr>
            <td width="22%"><b>Revision?</b>&nbsp;&nbsp;</td>
            <td width="44%">
                       <cfset IsChecked=masters.revision>
                        <cfinput type="checkbox"
                                    name="revision"
                                    value="1"
                                    checked="#IsChecked#">
            </td>

----------------------------------------------------------------------------
-------------

The checkbox value will only be posted to the processing page if it is
checked - so initialize parameter if it doesn't exist.

<cfparam name="form.revision" default="0">

<!--- Edit or Update? --->
<cfif IsDefined("Form.masterschedule_uuid") Is True>
            <cfupdate datasource="actevents" tablename="masteschedule">
<cfelse>
            <cfinsert datasource="actevents" tablename="masteschedule">
</cfif>
<cflocation url="masters.cfm">



----- Original Message -----
From: George Quade
To: [EMAIL PROTECTED]
Sent: Friday, April 16, 2004 9:31 AM
Subject: [KCFusion] CFUPDATE Problem


I have a SQL database with a field labeled Revision.  It is set to bit.

I have created the following in a cfform.

<tr>
            <td width="22%"><b>Revision?</b>&nbsp;&nbsp;</td>
            <td width="44%">
                        <cfset IsChecked=masters.revision>
                        <cfinput type="checkbox"
                                    name="revision"
                                    value="#masters.revision#"
                                    checked="#IsChecked#">
            </td>
----------------------------------------------------------------------------
----------------------------------------------
My problem is with the following for updating the information in the
database.

<!--- Edit or Update? --->
<cfif IsDefined("Form.masterschedule_uuid") Is True>
            <cfupdate datasource="actevents" tablename="masteschedule">
<cfelse>
            <cfinsert datasource="actevents" tablename="masteschedule">
</cfif>
<cflocation url="masters.cfm">


When I go back to view the information, the revision field is not set to 1
or 0.

What am I doing wrong?

George Quade
[EMAIL PROTECTED]


 
=========================================================
Kansas City ColdFusion User Group's website & listserv is 
hosted through the generous support of Clickdoug.com
To send email to the list, email  [EMAIL PROTECTED]
To (un)subscribe, email [EMAIL PROTECTED] with your request.
For hosting solutions http://www.clickdoug.com
Featuring Win2003 Enterprise, RedHat Linux, CFMX 6.1. 
======================================================

Reply via email to