UPDATE Album SET AlbumAvailable = 10 .....
checked>
[allowsmilie] => 1 [showsignature] => 0 [ipaddress] => [iconid] => 0 [visible] => 1 [attach] => 0 [infraction] => 0 [reportthreadid] => 0 [isusenetpost] => 1 [msgid] => [ref] => [htmlstate] => on_nl2br [postusername] => mxstu [ip] => webforumsuser@m [isdeleted] => 0 [usergroupid] => [membergroupids] => [displaygroupid] => [password] => [passworddate] => [email] => [styleid] => [parentemail] => [homepage] => [icq] => [aim] => [yahoo] => [msn] => [skype] => [showvbcode] => [showbirthday] => [usertitle] => [customtitle] => [joindate] => [daysprune] => [lastvisit] => [lastactivity] => [lastpost] => [lastpostid] => [posts] => [reputation] => [reputationlevelid] => [timezoneoffset] => [pmpopup] => [avatarid] => [avatarrevision] => [profilepicrevision] => [sigpicrevision] => [options] => [akvbghsfs_optionsfield] => [birthday] => [birthday_search] => [maxposts] => [startofweek] => [referrerid] => [languageid] => [emailstamp] => [threadedmode] => [autosubscribe] => [pmtotal] => [pmunread] => [salt] => [ipoints] => [infractions] => [warnings] => [infractiongroupids] => [infractiongroupid] => [adminoptions] => [profilevisits] => [friendcount] => [friendreqcount] => [vmunreadcount] => [vmmoderatedcount] => [socgroupinvitecount] => [socgroupreqcount] => [pcunreadcount] => [pcmoderatedcount] => [gmmoderatedcount] => [assetposthash] => [fbuserid] => [fbjoindate] => [fbname] => [logintype] => [fbaccesstoken] => [newrepcount] => [vbseo_likes_in] => [vbseo_likes_out] => [vbseo_likes_unread] => [temp] => [field1] => [field2] => [field3] => [field4] => [field5] => [subfolders] => [pmfolders] => [buddylist] => [ignorelist] => [signature] => [searchprefs] => [rank] => [icontitle] => [iconpath] => [avatarpath] => [hascustomavatar] => 0 [avatardateline] => [avwidth] => [avheight] => [edit_userid] => [edit_username] => [edit_dateline] => [edit_reason] => [hashistory] => [pagetext_html] => [hasimages] => [signatureparsed] => [sighasimages] => [sigpic] => [sigpicdateline] => [sigpicwidth] => [sigpicheight] => [postcount] => 2 [islastshown] => [isfirstshown] => [attachments] => [allattachments] => ) --> Updating my checkbox - Macromedia ColdFusion

Updating my checkbox - Macromedia ColdFusion

I have a checkbox field that I what to set or unset in my access database. If it is already checked, I have no problem unchecking it and the change reflected in my database. But I am having trouble changing unchecked to checked... Below are the code snippets <cfquery datasource="RecordStoreCF"> UPDATE Album SET ... , AlbumAvailable= <cfif IsDefined("FORM.AlbumAvailable") AND #FORM.AlbumAvailable# NEQ #AlbumQuery.AlbumAvailable#> #Isdefined(FORM.AlbumAvailable)# <cfelse> NULL </cfif> ... <form> <tr valign="baseline"> <td align="left" nowrap bgcolor="#eeeeee" class="headingColor"><strong>Available</strong></td> <td bgcolor="#FFFFFF"><input name="AlbumAvailable" type="checkbox" value="<cfoutput>#AlbumQuery.AlbumAvailable#</cfoutput>" <cfif (#AlbumQuery.AlbumAvailable# EQ 1)>checked</cfif>></td> </tr> </form>...

Sponsored Links
  1. #1

    Default Updating my checkbox

    I have a checkbox field that I what to set or unset in my access database. If
    it is already checked, I have no problem unchecking it and the change reflected
    in my database. But I am having trouble changing unchecked to checked...

    Below are the code snippets

    <cfquery datasource="RecordStoreCF">
    UPDATE Album SET ...

    , AlbumAvailable=
    <cfif IsDefined("FORM.AlbumAvailable") AND #FORM.AlbumAvailable# NEQ
    #AlbumQuery.AlbumAvailable#>
    #Isdefined(FORM.AlbumAvailable)#
    <cfelse>
    NULL
    </cfif> ...

    <form>
    <tr valign="baseline">
    <td align="left" nowrap bgcolor="#eeeeee"
    class="headingColor"><strong>Available</strong></td>
    <td bgcolor="#FFFFFF"><input name="AlbumAvailable"
    type="checkbox" value="<cfoutput>#AlbumQuery.AlbumAvailable#</cfoutput>" <cfif
    (#AlbumQuery.AlbumAvailable# EQ 1)>checked</cfif>></td>
    </tr>
    </form>

    Sponsored Links
    Ancient Guest

  2. #2

    Default Re: Updating my checkbox

    Assuming Album.AlbumAvailable is a YES/NO column, there are a few ways to do
    this. One method is ...

    <!--- YES == 1 and 0 == NO --->
    <cfquery ....>
    UPDATE Album
    SET AlbumAvailable = <cfif IsDefined("FORM.AlbumAvailable")>1<cfelse>0</cfif>
    .....
    </cfquery>


    <form ...>
    <cfoutput>
    <input name="AlbumAvailable" type="checkbox" value="1" <cfif
    AlbumQuery.AlbumAvailable EQ 1>checked</cfif>>
    </cfoutput>
    </form>


    mxstu Guest

  3. #3

    Default Re: Updating my checkbox

    Your solution led me in the right direction. I had to massage it a little... but I got it to work... thnx mxstu

    AT
    Ancient Guest

Similar Threads

  1. display and updating multipal checkbox, list and radio
    By daypick in forum Coldfusion - Getting Started
    Replies: 2
    Last Post: November 10th, 11:36 AM
  2. Replies: 5
    Last Post: July 27th, 04:11 AM
  3. Replies: 4
    Last Post: June 13th, 02:29 AM
  4. Updating an Access DB Yes/No field with a Checkbox value
    By Harry Devine in forum ASP.NET Data Grid Control
    Replies: 0
    Last Post: June 28th, 04:44 PM
  5. Updating AI Files causes position to 'bounce' when updating in Quark
    By Chris_Tod@adobeforums.com in forum Adobe Illustrator Macintosh
    Replies: 1
    Last Post: May 6th, 07:29 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •