Sorry if this has been answered before, but I haven't been able to find answer,
I have a working report card system using PDF "templates" for six different grades, that get populated with data from mySQL tables.
Teachers log in and enter data every school quarter, and upon submission, data gets written to record for current student.
All was working well, until a teacher pointed out that "unselected" checkbox values do not save as such.
Going back to HTML forms' need to include hidden form fields / values for unselected checkboxes, I tried adding hidden instances of checkboxes using same field names, but Acrobat won't allow duplicate field name.
So, question is, how do I pass a "No" value for an AcroFrom checkbox, that gets carried into a ColdFusion processing page / query ?
Thanks in advance for any and all help.
Jeff
The first thing you need to do is validate that the "Off" checkbox value is received correctly by the CF Script.
Next, there are a number of solutions.
1. Modify the DB to accept the values submitted by the form.
2. Modify the form, like you did for the HTML form, to submit the correct values. You can use radio buttons (both visible), or a second, hidden checkbox with the same field name. But some scripting will be needed to make sure that turning off the first check box, then turns on the second check box. This is a clunky solution, but easy to do if you know what you are doing.
3. Modify the CF script to translate the submitted value into what's needed for the DB. Use an explicit cfquery that uses a variable for the checkbox column. The cfquery will need to be proceeded by a script that converts the submitted value and places the result in the variable.
Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script