I have a coldfusion page that emails to some recipients. There is a <CfIF> that means that if a hidden field has a certain value based on a checkbox it will add the header information bto the email. The javascript works
function TestChk(){
var checkbox = document.getElementById('chkTestAcct')
,hidden = document.getElementById('ToTestAcct');
checkbox.addEventListener('change', function(){
hidden.value = (this.checked)? 'Yes' : 'No';
//alert("Hidden value: '" + hidden.value + "");
}, false )
}
When implenting this code I get the 500 error:
<cfif #form.ToTestAcct# EQ "Yes">
<cfoutput>Its Yes</cfoutput>
<cfmail
from="nbeo@optometry.org"
subject="Registration Information"
to="brian.mccown@optometry.org"
BCC="nbeo@optometry.org"
type="html">
<cfelse>
<cfmail
from="nbeo@optometry.org"
subject="Registration Information"
to="bmccown8@gmail.com"
CC="gregorio.zambrana@optometry.org"
BCC="nbeo@optometry.org"
type="html">
</cfif>
What am I doing wrong? This should work. Thanks in advance.
function TestChk(){
var checkbox = document.getElementById('chkTestAcct')
,hidden = document.getElementById('ToTestAcct');
checkbox.addEventListener('change', function(){
hidden.value = (this.checked)? 'Yes' : 'No';
//alert("Hidden value: '" + hidden.value + "");
}, false )
}
When implenting this code I get the 500 error:
<cfif #form.ToTestAcct# EQ "Yes">
<cfoutput>Its Yes</cfoutput>
<cfmail
from="nbeo@optometry.org"
subject="Registration Information"
to="brian.mccown@optometry.org"
BCC="nbeo@optometry.org"
type="html">
<cfelse>
<cfmail
from="nbeo@optometry.org"
subject="Registration Information"
to="bmccown8@gmail.com"
CC="gregorio.zambrana@optometry.org"
BCC="nbeo@optometry.org"
type="html">
</cfif>
What am I doing wrong? This should work. Thanks in advance.