Connecting Tech Pros Worldwide Forums | Help | Site Map

Multiple update with checkboxes and cfloop

Newbie
 
Join Date: Jul 2008
Posts: 4
#1: Jul 17 '08
Hi all!
How can I update only selected records from recordset at once?
We have a form page form.cfm and processing page update.cfm.
In form page there is a list of rows generated with <cfoutput query>. Each row contain checkbox, textfield1, textfield2.
Processing page has a query procedure.
I tried cfloop, but always got an error: If checkbox is not checked, variable of checkbox become undefined.

What is the solve of this problem?
acoder's Avatar
Site Moderator
 
Join Date: Nov 2006
Location: UK
Posts: 14,581
#2: Jul 17 '08

re: Multiple update with checkboxes and cfloop


If the checkbox is not checked, it won't be passed to the submitted page. Use cfparam for defaults and check against that.
Newbie
 
Join Date: Jul 2008
Posts: 4
#3: Jul 18 '08

re: Multiple update with checkboxes and cfloop


Quote:

Originally Posted by acoder

If the checkbox is not checked, it won't be passed to the submitted page. Use cfparam for defaults and check against that.

Yes, quite right. Cfparam helps!
acoder's Avatar
Site Moderator
 
Join Date: Nov 2006
Location: UK
Posts: 14,581
#4: Jul 18 '08

re: Multiple update with checkboxes and cfloop


Glad to hear it. Post again if you have more questions.
Reply