User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the ColdFusion section within the Web Development category of DaniWeb, a massive community of 375,238 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,128 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our ColdFusion advertiser:
Views: 692 | Replies: 1
Reply
Join Date: Jan 2008
Posts: 1
Reputation: alakacha is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
alakacha alakacha is offline Offline
Newbie Poster

Help Updating checkboxes

  #1  
Jan 31st, 2008
How do you update checkboxes on a form in cold fusion?

I am using the following code to update other form elements :

<cfquery name="qry_content" datasource="A4265_gbci">
update tbl_emailsignup
set firstname = '#form.firstname#' ,
lastname = '#form.lastname#' ,
email = '#form.email#' ,
job = '#form.job#',
company = '#form.company#' ,
address1 = '#form.address1#' ,
address2 = '#form.address2#' ,
city = '#form.city#' ,
state = '#form.state#' ,
zip = '#form.zip#' ,
phone = '#form.phone#'
where id = #form.id#
</cfquery>
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Nov 2007
Posts: 51
Reputation: Nige Ridd is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 9
Nige Ridd Nige Ridd is offline Offline
Junior Poster in Training

Re: Updating checkboxes

  #2  
Feb 2nd, 2008
The value of a check box can be set using something like
<cfinput type="checkbox"
name="SelectedDepts"
value="4">
BUT this value will only be returned if the user checks the box, so either do an isDefined or use cfparam to default it to something.

One thing you should consider as well is changing your query to use cfqueryparam instead of puttine the actual value in quotes into the statement. This aids performance and also helps stop quotes in the data causing problems.
Nige
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

DaniWeb ColdFusion Marketplace
Thread Tools Display Modes

Similar Threads
Other Threads in the ColdFusion Forum

All times are GMT -4. The time now is 4:28 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC