We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 6726
    • 7,075 Posts
    Okay, I gave this a go but I have little experience with eForm and I get an error which I am sure derives from a stupid thing...

    The error message I get : "Tampering attempt detected!"

    For the record, I use eForm 1.4.4 / MODx 0.9.6.1p2 and I have PHx 2.1.3 turned on with pixelchutes workaround applied.

    Now here is my "Send to Friend" form :

    
    <p class="error"> [+validationmessage+] </p>
    
    <form action="[~[*id*]~]" id="SendToFriend" method="post" name="SendToFriend">
        <fieldset>
    
            <h3>Recommend this page</h3>
    
              <input type="hidden" name="formid" value="SendToFriend" />
     
            <p><label for="sfName1">Your name : <input class="text" id="sfName1" name="name1" type="text" /></label></p>
     
            <p><label for="sfEmail1">Your email : <input class="text" id="sfEmail1" name="from" type="text" /></label></p>
     
            <p><label for="sfName2">Friend's name : <input class="text" id="sfName2" name="name2" type="text" /></label></p>
    
            <p><label for="sfEmail2">Friend's Email : <input class="text" id="sfEmail2" name="email" type="text" /></label></p>
    
          <input name="link" type="hidden" value="[~[*id*]~]" />
          <input class="button" id="sfRecommend" name="recommend" type="submit" value="Send" />
        </fieldset>
    </form>
    


    As you can see, I have set a hidden field to retrieve the path to the page and construct the link sent with the form (I am not sure it’s a correct use but that’s how I gave it a try).

    I added <input type="hidden" name="formid" value="SendToFriend" /> though from the doc I understand this is not necessary since 1.4 final.


    And here is the very simple report chunk :

    <p>Hi [+name2+],<br />
    [+name1+] thinks that this page : [(site_url)][+link+] could be of interrest to you</p>


    And now the eForm call :

    [tt][!eForm? &formid=`SendToFriend` &tpl=`formSendToFriend` &report=`SendToFriendReport` &thankyou=`thankYou` &to=`[+email+]` &from=`[+from+]`!][/tt]

    I call the snippet from a cached page.

    There is also a Jot comment form on the page (you can all see it here) : http://www.pargade-notaires.fr/blog/pratique-notariale/delai-de-retractation-et-immeuble-a-usage-mixte.html
    (The form is toogled with jQuery, with the link "Formulaire d’envoi" at the end of the right column content).

      .: COO - Commerce Guys - Community Driven Innovation :.


      MODx est l&#39;outil id
      • 36416
      • 589 Posts
      Quote from: davidm at Apr 09, 2008, 05:28 PM

      Okay, I gave this a go but I have little experience with eForm and I get an error which I am sure derives from a stupid thing...
      The error message I get : "Tampering attempt detected!"

      Add eform="::0::" tag for the hidden calculated field in your form template.
        • 6726
        • 7,075 Posts
        Thanks I’ll try that !

        (now that you mention it, I vaguely recall reading something about this tongue )
          .: COO - Commerce Guys - Community Driven Innovation :.


          MODx est l&#39;outil id
          • 6726
          • 7,075 Posts
          It seems to be working now, I get the success message and now I’ll check my mail to see how that goes...
            .: COO - Commerce Guys - Community Driven Innovation :.


            MODx est l&#39;outil id
            • 6726
            • 7,075 Posts
            I have done some testing and the email is not sent sad

            As you have seen, my call is uncached on a cached page.
            There is also a Jot call on the page and PHx is turned on (eForm is modified with pixelchutes latest workaround for dynamic parameters).

            To isolate the problem, I have created a test page where there is no Jot call.
            Same result.

            Then I deactivated PHx and restored the dynamic parameters in the eForm call and guess what : it works !

            Which means that pixelchutes latest workaround is not working (at least for me).
            I’ll try the older workaround see if it works !

              .: COO - Commerce Guys - Community Driven Innovation :.


              MODx est l&#39;outil id
              • 6726
              • 7,075 Posts
              Never mind, I have done a stupid typo cpoying /pasting pixelchute’s code which works admirably well !

              Solved smiley
                .: COO - Commerce Guys - Community Driven Innovation :.


                MODx est l&#39;outil id
                • 27330
                • 884 Posts
                David any chance for a link of a working example, if not public a PM will do wink
                  • 7231
                  • 4,205 Posts
                  The link in the first post takes you to an example. The tell-a-friend form is hidden, you need to click on the link that reads "Conseiller cet article" - it has an icon like someone thinking about the newspaper.
                    [font=Verdana]Shane Sponagle | [wiki] Snippet Call Anatomy | MODx Developer Blog | [nettuts] Working With a Content Management Framework: MODx

                    Something is happening here, but you don&#39;t know what it is.
                    Do you, Mr. Jones? - [bob dylan]
                    • 27330
                    • 884 Posts
                    thanks Shane, my French isn’t so good smiley I searched for the term David put.
                    that’s a sleek one, much nicer than my Thickbox way. I’ll try David’s way right away.
                      • 6726
                      • 7,075 Posts
                      Sorry guys I have been strolling Paris streets all day, great weather here, and went to the movies... just got back.

                      If it can help, this is all "as is".

                      Here is my eForm call :

                      <p style="text-align: right; margin-top: 15px;"><img src="assets/templates/pargade/images/stf.png" /><a href="#"' id="show_stf">Conseiller cet article</a></p>
                      [!eForm? &formid=`SendToFriend` &tpl=`formSendToFriend` &report=`SendToFriendReport` &thankyou=`thankYou` &to=`((email))` &from=`((emailfrom))` &bcc=`[email protected]` &fromname=`((name1))` &subject=`((name1)) vous recommande un article de pargade-notaires.fr` &vericode=`1` &protectSubmit=`0`!]
                      
                      


                      The jquery bit :


                      <script type="text/javascript">
                      
                      var $j = jQuery.noConflict();
                      
                          $j(document).ready(function() {
                                   $j('#stf').hide(); 
                      
                                   $j('a#show_stf').click(function() {
                                               $j('#stf').toggle(400);
                                              return false;  }); 
                           }); 
                      
                      </script>


                      Here is the chunk formSendToFriend I use :

                      <div id="stf">
                      <!-- La ligne suivante est obligatoire -->
                      <p class="error"> [+validationmessage+] </p>
                       
                      <!-- Début du formulaire -->
                      <form action="[~[*id*]~]" id="SendToFriend" method="post" name="SendToFriend">
                          <fieldset>
                      
                                <input type="hidden" name="formid" value="SendToFriend" />
                            
                              <p><label for="sfName1"><strong>Votre nom :</strong> <input class="text" id="sfName1" name="name1" type="text" /></label></p>
                       
                              <p><label for="sfEmail1"><strong>Votre Email : </strong><input class="text" id="sfEmail1" name="emailfrom" type="text" eform="Votre adresse email:email:1"/></label></p>
                       
                              <p><label for="sfName2"><strong>Nom de votre ami :</strong> <input class="text" id="sfName2" name="name2" type="text" /></label></p>
                      
                              <p><label for="sfEmail2"><strong>Email de votre ami : </strong><input class="text" id="sfEmail2" name="email" type="text" eform="Adresse email de votre ami:email:1" /></label></p>
                       
                       <p style="padding-top: 10px;">Merci de saisir le code de vérification suivant :</p>
                       <img src="[+verimageurl+]" alt="code de vérification" style="border: 1px solid #ccc; margin: 10px 0px;"/>
                       <p><label accesskey="c" for="vericode">Code</label><input type="text" name="vericode" size="20" /></p>
                      
                              <!-- Bouton de validation et d'envoi du message --> 
                            <input name="urlsite" type="hidden" value="[(site_url)]" eform="::0::" />
                            <input name="link" type="hidden" value="[~[*id*]~]" eform="::0::" />
                            <input name="title" type="hidden" value="[*pagetitle*]" eform="::0::" />
                            <input class="button" id="sfRecommend" name="recommend" type="submit" value="Envoyer" />
                          </fieldset>
                      </form>
                      </div>
                      


                        .: COO - Commerce Guys - Community Driven Innovation :.


                        MODx est l&#39;outil id