We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 8741
    • 17 Posts
    I’m attempting my first shot at using eForm. For the most part, I think I understand how to use it. The only piece I’m missing is how I can redirect once validation is done. Here’s the flow of what I need to happen:


    • User fills in form and submits
    • Form is validated with custom validation
    • If validation checks out, then redirect to a new site with form values attached as the querystring

    My questions:

    • Would I do the redirect as part of my validation snippet? Or should I write a separate snippet for that?
    • Finally, is there a specific way I need to do the redirect within the MODx system?


    Thank you!
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      I suspect that you will need to use a snippet and eForm’s &eFormOnValidate event. See the documentation in the eForm’s snippet directory (assets/snippets/eform/docs) for examples on how to create such a snippet.

        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
        • 8741
        • 17 Posts
        Quote from: sottwell at Aug 10, 2009, 03:35 PM

        I suspect that you will need to use a snippet and eForm’s &eFormOnValidate event. See the documentation in the eForm’s snippet directory (assets/snippets/eform/docs) for examples on how to create such a snippet.

        Thanks Susan. Do you know though if there’s a different function call within MODx that I should use for redirects instead of the PHP function "header"?

        I appreciate your help!
          • 28042 ☆ A M B ☆
          • 24,524 Posts
          Check out the $modx->sendRedirect API function.

          http://wiki.modxcms.com/index.php/API:sendRedirect
            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
            • 8741
            • 17 Posts
            Quote from: sottwell at Aug 10, 2009, 03:52 PM

            Check out the $modx->sendRedirect API function.

            http://wiki.modxcms.com/index.php/API:sendRedirect

            Beauty! Thank you!