We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 23703
    • 180 Posts
    If I understand this correctly, you can’t manually break the lines in a snippet call. It has to be on a single line. Try removing the linebreaks and see if that fixes it. I think it’s written like that in the manual for clarity since it is a long call.
      • 11214
      • 225 Posts
      rolleyes Oh yes.. Indeed on! I am really stupid..
      That works perfectly.
      Thank you very much wink

      Is the version 1.4 useful in production or it is better to stay in 1.3?
        Verum Index sui et falsi
        • 11214
        • 225 Posts
        Hello,

        Is it possible to insert automatically, in the form fields Your Name and Your Email Adress, the name and the email of the registered user if is login ?
          Verum Index sui et falsi
          • 28042 ☆ A M B ☆
          • 24,524 Posts
          I hacked a copy of eForm to get the data from the SESSION as well as the POST. I added this between the vericode setting and the build form section:
          	// set vericode
          	if($vericode) {
          		$_SESSION['eForm.VeriCode'] = $fields['vericode'] = substr(uniqid(''),-5);
          	}
          
          		# get SESSION data - added by sottwell
          		if(isset($_SESSION['xxxx'] && !empty($_SESSION['xxxx'])) {
          			$value = $_SESSION['xxxx'];
          			$fields[$name] = $value;
          		}
          
          	# build form
          	return formMerge($tpl,$fields);
          }
          

          Add as many as you need.
            Studying MODX in the desert - http://sottwell.com
            Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
            Join the Slack Community - http://modx.org
            • 11214
            • 225 Posts
            Thank you very much. It is very interesting and exactly for what I asked you. But in fact, and at the moment, I have a more elementary problem..... My form (it is the example of the feedBack form) displays correctly, but does not verify fields.

            Nevertheless, the form HTML contains well :

            <p><span style="color:#900;">[+validationmessage+]</span></p>


            On the other hand, I replaced well the addresses of the call of the snippet:

            [ [EForm? *formid = ’ feedbackForm ’ *to = ` [email protected], [email protected], [email protected] ` *tpl = ’ eFeedBackForm ’ *report = ’ eFeedbackReport ’ *thankyou = ’ eFeedbackThanks ’ *mailselector = ’ department ’ *vericode = ’1’ *subject = " Web feedback site "]]

            by mine...But I receive nothing! I had the same problem with the version 1.3... Maybe I missed a stage?
              Verum Index sui et falsi
              • 30223
              • 1,010 Posts
              [ [EForm? *formid = ’ feedbackForm ’ *to = ` [email protected], [email protected], [email protected] ` *tpl = ’ eFeedBackForm ’ *report = ’ eFeedbackReport ’ *thankyou = ’ eFeedbackThanks ’ *mailselector = ’ department ’ *vericode = ’1’ *subject = " Web feedback site "]]

              If this is how you have your snippet call I’m not suprised... smiley You have all paprameters starting with a * instead of an & and you have used some single quotes (’) and double quotes (") instead of backticks (`). Perhaps if you write it like this it might work.

              [ [EForm? &formid=`feedbackForm` &to=`[email protected],[email protected],[email protected]` &tpl=’eFeedBackForm` &report=`eFeedbackReport` &thankyou=`eFeedbackThanks` &mailselector=`department` &vericode=`1` &subject =`Web feedback site`]]

                • 11214
                • 225 Posts
                Sorry, it seems a past/copy error....

                No, alla parameters start with & and it don’t work. This is my snippet call :

                [[eForm? &formid=`feedbackForm` &to=`info@...,support@...,requests@...` &tpl=`eFeedBackForm` &report=`eFeedbackReport` &thankyou=`eFeedbackThanks` &mailselector=`department` &vericode=`1` &subject="Web site feedback"]]

                whith the good link in the ... to the site.

                I do not understand... Thank you when even!

                  Verum Index sui et falsi
                  • 7923
                  • 4,213 Posts
                  Your &subject parameter still contains double quotes. Also, if you are using RTE on the document, make sure you check how the snippet call looks in the source view, by using the source button in RTE (or by disabling RTE for that document altogether). There might be for example html tags inside the snippet call from RTE if you have used bolding or something. Or if you have had the snippet call on a multiple lines, there might be paragraph tags..

                  Also, call your snippet uncached using [!...!] or have the document set to not cacheable. That is needed for the POST data to be parsed.


                    "He can have a lollipop any time he wants to. That's what it means to be a programmer."
                    • 11214
                    • 225 Posts
                    laugh laugh laugh laugh Tank you very much !!!!

                    It’s WORK !

                    It was just a problem because my snippet was uncached !

                      Verum Index sui et falsi
                      • 25663 MODX Staff
                      • 12,272 Posts
                      Quote from: sottwell at Oct 15, 2006, 05:29 AM

                      I hacked a copy of eForm to get the data from the SESSION as well as the POST. I added this between the vericode setting and the build form section:
                      	// set vericode
                      	if($vericode) {
                      		$_SESSION['eForm.VeriCode'] = $fields['vericode'] = substr(uniqid(''),-5);
                      	}
                      
                      		# get SESSION data - added by sottwell
                      		if(isset($_SESSION['xxxx'] && !empty($_SESSION['xxxx'])) {
                      			$value = $_SESSION['xxxx'];
                      			$fields[$name] = $value;
                      		}
                      
                      	# build form
                      	return formMerge($tpl,$fields);
                      }
                      

                      Add as many as you need.

                      Could this make a good stock addition that looped through a set of comma-seperated parameter values like:

                      &sessionVars=`items,quantities,ccNum,ccExp`


                      so that it could be used for a variety of functions like making a manual e-commerce order form from shopX, for example?
                        Ryan Thrash, MODX Co-Founder
                        Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me