I am processing a form with CF, it has the usual e-mail text fields and a name and message field. Above it however are 22 check boxes that represent some aspect or topic that the viewer is interested in applying for. How do i include any checkbox values checked in the form within the <CFMAIL> tag and do i have to write a <CFIF ISDefined> tag and include an OR statement to take care of all the variables passed across to the form processing page. I have never included checkbox values in form processing before so a big thanks for any help.
regards
silverfox
mmi
11-18-2001, 01:45 AM
hey silverfox - as you might imagine, from my experience Cold Fusion is something that happens to ice cubes in a glass - while you're waiting for a physicist/db'er to answer this, ya might want to scan this search return (http://www.google.com/search?hl=en&q=%22Cold+Fusion%22+checkbox+values+%3CCFMAIL%3E&btnG=Google+Search)
jonsteele
11-18-2001, 07:42 AM
My suggestion would be to name the checkboxes consecutively (i.e. b1, b2, b3, etc.) then loop through them checking the dynamic variable.
Hi again jon, many thanks for the previous help, just one more small thing. Once I have the "interest" variable how do i use that inside the <CFMAIL> tag to display which checkbox has been clicked and if they are called b1, b2 etc how will the reciever know which is the name of the item associated with b1 or b2 etc, in this case they relate to furniture types
And the user checks Type 1 and Type 3, the value of the interest variable would be: Type 1, Type 3.
The interest variable has the value attribute of the check input tag.
:) Jon
silverfox63
11-19-2001, 12:07 PM
Hi Jon, I did get the below error for some reason, also, did you mean to put hash marks around ~number_of_items# or do i just put the number of checkboxes to loop thru, in this case 26 with no hash marks around them.
thanks
Lee
--
Error Occurred While Processing Request
Error Diagnostic Information
An error occurred while evaluating the expression:
#Evaluate("form.b#x#")# neq "null"
Error near line 61, column 31.
--------------------------------------------------------------------------------
An error has occurred while processing the expression:
The specified form field cannot be found. This problem is very likely due to the fact that you have misspelled the form field name.
The error occurred while processing an element with a general identifier of (CFIF), occupying document position (61:2) to (61:42) in the template file C:\Inetpub\wwwroot\contact_brochure_form.cfm.
jonsteele
11-19-2001, 11:07 PM
#numer_of_items# is just a number, so you could put 26 directly in the cfloop tag.
Re the error, I have no idea what the problem is. It even says that form.b1 is a form field. Unless you misspelled it in the form, I have no idea.
You are putting this on the page the form is submitting to, right? :)