I’m working on a site and I’m am using eForm to create a "send to a friend" email form, I’m not sure why this isn’t working right. I have a checkbox to CC the Sender when checked. However, whether or not the "ccsender" checkbox is checked, the sender is always CC’d on every form submission. I only want the sender to get CC’d when the ccsender checkbox is checked. I tested the snippet call with a hard-coded &ccsender=`1` and &ccsender=`0` and it worked as expected. Additionally, I output the placeholder [+ccsender+] to screen and when the box was checked it displayed the correct 1 and 0 values.
Here’s my snippet call:
[!eForm? &formid=`LL_SendtoFriendSiteForm` &to=`[+recipient_email+]` &from=`[+email+]` &ccsender=`[+ccsender+]` &fromname=`[+sender_name+]` &tpl=`LL_SendtoFriendSiteForm` &report=`LL_SendtoFriendSiteEmail` &thankyou=`LL_SendtoFriendSiteThanks` &vericode=`1` &subject=`[+sender_name+] ([+email+]) has sent you a link to Linda Loo's` &eFormOnBeforeMailSent=`updateDB` !]
Here’s my form "chunk" code:
[+validationmessage+]
<form method="post" action="[~[*id*]~]">
<fieldset>
<legend>Send to a Friend</legend>
<input type="hidden" name="formid" value="LL_SendtoFriendSiteForm" />
<div>
Enter your friend's email address
<input type="text" maxlength="200" size="30" name="recipient_email" id="recipient_email" tabindex="1000" eform="Your Friend's email address:email:1" />
</div>
<div>
Your Full Name:<br/>
<input type="text" maxlength="100" size="30" name="sender_name" id="sender_name" tabindex="1001" eform="Your Full Name::string :0" />
</div>
<br />
<div>
Your Email Address:<br/>
<input type="text" maxlength="100" size="30" name="email" id="sender_email" tabindex="1002" eform="Your Email Address:email:1" />
<br />
<input type="checkbox" id="ccsender" value="1" name="ccsender" tabindex="1003" />
<label for="ccsender">Send me a copy of this message</label>
Add a personal message:<br/>
<textarea cols="30" rows="4" name="personal_msg" wrap="virtual" id="personal_msg" tabindex="1004" eform="Add a personal message:html:0"></textarea>
</div>
<div>
Please enter the anti spam code below:<br />
<div id="img_vericode">
<img src="[+verimageurl+]" alt="verification code" border="1"/>
</div>
<div id="enter_vericode">
<label accesskey="c" for="vericode">Enter Code</label>
<input type="text" name="vericode" size="20" tabindex="1005" />
</div>
<div>
<input type="submit" value="Send to a Friend" name="submit" tabindex="1006"/>
</div>
</fieldset>
</form>
I’m a bit unsure why this isn’t working correctly, any help would be appreciated. Thanks.