We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 38800
    • 35 Posts
    I'm a newbie to MODX, using MODX Revolution 2.2.0-pl2 with FormIt 2.0.3.

    I'm using the following blog post as a guide to setting up a very simple contact form with FormIt:

    http://codingpad.maryspad.com/2011/03/08/modx-revolution-for-complete-beginners-part-9-using-formit-for-contact-forms/

    I have the following snippet call at the top of the page that contains my form:

    [[!FormIt? 
    &hooks=`email` 
    &emailTpl=`sentEmailTpl` 
    &emailSubject=`Message from Learn MODx Revo Website`
    &emailTo=`[email protected]`
    &redirectTo=`6` 
    ]]


    When I complete the form in a browser, the e-mail is sent correctly, but the redirect to my "Thank you for your message" page doesn't work. The form clears, and it stays on the form page.

    My "Thank you for your message page" has a "Menu Index" of 6, which I'm assuming is another name for the Page ID.

    As far as I can see I've set things up correctly, but there's clearly something wrong. Suggestions for what I might check next would be much appreciated!

    Cheers,
    Dave
    • No, Menu Index is to specify the order in which the pages will be listed in a menu (and by default in the Resource Tree as well). The ID you need is in (xx) to the right of the resource name in the Tree listing.

      These may by coincidence be the same as you create resources, but they are in no way related.
        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
        • 38800
        • 35 Posts
        Thanks Susan - that makes sense. In this case they're the same because, as you say, they both just increment in the order that I created the resources.

        This means I can rule out an incorrect Page ID as being the problem - my "Thank you for your message" page does indeed have an ID of 6. Rats! (but that'd have been too easy!)

        Anything else I might look at?
          • 38800
          • 35 Posts
          I found the problem. Line 2 of my snippet call above says

          &hooks=`email` 


          ...and of course it should read

          &hooks=`email, redirect` 


          Doh!