I have a form that contains one checkbox group and one radio button group. I would like to validate the form to ensure that at least one checkbox is selected and one radio button is selected. "form.competition" is the checkbox group and "form.radiogroup1" is the radio button group. This code gives me an error. Any advice?
<CFIF form.name_REQ is not "" AND
form.company_REQ is not "" AND
form.phone_REQ is not "" AND
form.competition is not "" AND
form.radiogroup1 is not "">
<cfmail
TO="email@hotmail.com"
From="#form.sender#"
Subject="Online Request For Quote">
#DateFormat (Now())# #TimeFormat(Now())#
----------Contact Information----------
Name: #form.name_REQ#
Company: #form.company_REQ#
Address: #form.address#
City,State,Zip: #form.citystatezip#
Phone: #form.phone_REQ#
Ext.: #form.phonext#
Fax: #form.fax#
email: #form.sender#
----------Application Information----------
Application: #form.application#
Product Type: #form.product#
Speed: #form.CPMspeed#
First Priority: #form.priorityone#
Second Priority: #form.prioritytwo#
Construction: #form.frametype#
Closure Type: #form.closuremethod#
Pack Configuration: #form.packpattern#
Funding: #form.funding#
Samples: #form.samples#
----------Competition----------
#form.competition#
----------Project Description----------
Description: #form.Description#
----------Carton or Case----------
#form.radiogroup1#
----------Dimensions----------
Length 1: #form.LOne#
Width 1: #form.WOne#
Depth 1: #form.DOne#
Length 2: #form.LTwo#
Width 2: #form.WTwo#
Depth 2: #form.DTwo#
Length 3: #form.LThree#
Width 3: #form.WThree#
Depth 3: #form.DThree#
--------------- end ---------------
</cfmail>
<cfoutput>
<div align="right">#DateFormat (Now())# #TimeFormat(Now())# </div><br>
<br>
Thank you for your request #form.name_REQ#. We will process your request and contact you as soon as possible.<BR>
<br>
<div align="center"><a href="../home.html">Return to Homepage</a> </div>
</cfoutput>
<cfelse>
<H3>You are missing a required piece of information for this form to be processed.</H3>
<br>
Please <a href="javascript:history.go(-1)">Click here</a> to go back and complete all fields marked with an asterisk(*).
</CFIF>
<CFIF form.name_REQ is not "" AND
form.company_REQ is not "" AND
form.phone_REQ is not "" AND
form.competition is not "" AND
form.radiogroup1 is not "">
<cfmail
TO="email@hotmail.com"
From="#form.sender#"
Subject="Online Request For Quote">
#DateFormat (Now())# #TimeFormat(Now())#
----------Contact Information----------
Name: #form.name_REQ#
Company: #form.company_REQ#
Address: #form.address#
City,State,Zip: #form.citystatezip#
Phone: #form.phone_REQ#
Ext.: #form.phonext#
Fax: #form.fax#
email: #form.sender#
----------Application Information----------
Application: #form.application#
Product Type: #form.product#
Speed: #form.CPMspeed#
First Priority: #form.priorityone#
Second Priority: #form.prioritytwo#
Construction: #form.frametype#
Closure Type: #form.closuremethod#
Pack Configuration: #form.packpattern#
Funding: #form.funding#
Samples: #form.samples#
----------Competition----------
#form.competition#
----------Project Description----------
Description: #form.Description#
----------Carton or Case----------
#form.radiogroup1#
----------Dimensions----------
Length 1: #form.LOne#
Width 1: #form.WOne#
Depth 1: #form.DOne#
Length 2: #form.LTwo#
Width 2: #form.WTwo#
Depth 2: #form.DTwo#
Length 3: #form.LThree#
Width 3: #form.WThree#
Depth 3: #form.DThree#
--------------- end ---------------
</cfmail>
<cfoutput>
<div align="right">#DateFormat (Now())# #TimeFormat(Now())# </div><br>
<br>
Thank you for your request #form.name_REQ#. We will process your request and contact you as soon as possible.<BR>
<br>
<div align="center"><a href="../home.html">Return to Homepage</a> </div>
</cfoutput>
<cfelse>
<H3>You are missing a required piece of information for this form to be processed.</H3>
<br>
Please <a href="javascript:history.go(-1)">Click here</a> to go back and complete all fields marked with an asterisk(*).
</CFIF>