We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 9122
    • 27 Posts
    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.
      • 14505
      • 7 Posts
      I’m having a similar issue. Did you ever find a fix?
        • 9122
        • 27 Posts
        I haven’t got this fixed yet. I removed the CC field from the forms temporarily while I work on some of the more critical aspects of the site. I’m hoping to get back to troubleshooting this problem in the next couple of weeks.
          • 19787
          • 28 Posts
          I am having the exact same issues as estring. I am also trying to have a "send me a copy" checkbox, but for some reason the eform snippet does not seem to accept a placeholder value for "ccsender" eg - &ccsender=`[+ccsender+]`

            • 38685
            • 59 Posts
            Hi guys.... I have a few problems sorting out placeholder problems myself...

            You probably should be using a different variable name for your placeholder....
            ie <input type="checkbox" name="checkccsender" value="1" eform="Add CC Sender::0: />
            Then check it and add some extra code to get it to do what you want ie...

            		if($fields['checkccsender'] = '1') {	// check that checkccsender is set
             			$ccsender = "1"
            		}
            

            add this at line 336 of the eform.inc.php...

            I found a work-a-round for my placeholder problem which is described here....
            http://modxcms.com/forums/index.php/topic,40482.msg245095.html#msg245095

            BTW - I think you are confusing [+placeholders+] with eform parameters...

            PS. I haven’t tested this but I think the logic is correct... chime in if I am wrong!

            So I hope this helps...
            Paul

              Paul AL Bakulich - Association for Computing Machinery Professional Member
              http://palbakulich.me/ | http://twitter.com/#!/palhmbs
              • 25511
              • 13 Posts
              This is very old thread but best I could find.. Anyways, we had same problem: wanted to have checkbox for user to tick if he/she want's copy. If ccsender value is set though form input, cc is always sent despite the value.

              So we made small fix to enable this feature. Add this line to eForm snippet just before # Start processing

              // BB ccsender checkbox workaround
              if (isset($_POST['ccsender']) && !empty($_POST['ccsender'])) $params['ccsender'] = 1;
              


              Now simply add checkbox "ccsender" with any (not empty) value to your form and when it's ticked, ccsender is enabled.

              You can use radiobuttons too but remeber to leave "No" option value empty.

              Happy CCing!!