•
•
•
•
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
![]() |
•
•
Join Date: Jan 2008
Posts: 1
Reputation:
Rep Power: 0
Solved Threads: 0
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>
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>
•
•
Join Date: Nov 2007
Posts: 51
Reputation:
Rep Power: 1
Solved Threads: 9
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
<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
![]() |
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
•
•
•
•
DaniWeb ColdFusion Marketplace
Similar Threads
- svchost.exe - Windows Update - 100% CPU Utilization fix (EASY) (Windows NT / 2000 / XP / 2003)
- can't get rid of infection (Viruses, Spyware and other Nasties)
- Please Help Me! Please! [HJT Log included] (Viruses, Spyware and other Nasties)
- Hjt Log..please Help!?!? (Viruses, Spyware and other Nasties)
Other Threads in the ColdFusion Forum
- Previous Thread: Calling .cfm page from ASP.NET
- Next Thread: Need help with NULL values


Linear Mode