We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 37287
    • 10 Posts
    Hey Guys,

    I hope this is an easy process! I've set up a form on my site using eform. How do i pass the forms variables to my thank you page url (ie.../thankyou.html?name=xxxx&email=xxxx&phone=xxxx)?

    When someone fills out the form it generates the thank you page with the url i specified with a query string of my forms data. I've been struggling with this for a while now! Can someone please help me?

      • 16278
      • 928 Posts
      Maybe the built-in &thankyou parameter would do what you want - then you'd have all the relevant fields available as placeholders.

      &thankyou (Optional)
      chunk name (non-numeric) or document id (numeric) to use as a thank you message displayed to the user after a successful submit. Tags: same as for &tpl

      :) KP
        • 37287
        • 10 Posts
        Hey KP,

        Thanks for the reply! How would the &thankyou parameter work if i can't place a physical url in it? How do i pass the forms variables in it? Is there an example of how this might work since im fairly new to MODX.

        - stevo [ed. note: stevo3423 last edited this post 15 years ago.]
          • 16278
          • 928 Posts
          Create your thank-you page as a resource, like other pages on your site, with the text you want to display on the page, using the same placeholders as in the report template for the variables. Then use the resource's ID number as the value for the &thankyou parameter. MODX and eform will look after the business of creating the URL and passing the data for you.

          If you installed the Evo sample site, try replacing the contact page eform call's &gotoid parameter with &thankyou, and add some placeholders to the thankyou page.

          :) KP
            • 37287
            • 10 Posts
            Thanks KP!

            That makes sense. One more question! I apologize!

            How can i pass the forms data to a url outside of my domain name?

            Once the user fills out the form (using eform):
            www.domain.com/contact.html


            Its then sent to another url to post the forms data (in a crm):
            www.crm.com/?name=xxxx&email=xxxx&phone=xxxx


            Is it possible to do this using the same concept you described?

            - stevo
              • 16278
              • 928 Posts
              I think you'd be able to do that using one of the eform event hooks, such as &eFormOnMailSent, and MODX's sendRedirect() API function. You should find some documentation and examples in a "doc" folder in the eform snippet's directories.
              :) KP