We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 50190
    • 6 Posts
    Hi

    I've looked though a few posts of people stating the same issue. Sadly their fixes haven't helped in my case.

    Simply, the redirect on my form isn't working.

    My template has this formit snippet call:
    [[!FormIt?
           
           	&hooks=`redirect,recaptcha,spam,FormSave,email,user.email.snippet`
            &validate=`name:required,address:required,email:required:email,contact-type:required,enquiry:required`
            &errorMessage=`Please ensure all required fields are filled out.`   
            &clearFieldsOnSuccess=`1`
            &fsFormTopic=`[[*pagetitle]]`
            
            &emailSubject=`DCH: [[*pagetitle]] form submission`
            &emailTpl=`buy.from.dch.body.chunk`
            
            &emailFrom=`[email protected]`
            &emailFromName=`DCH`
            
            &emailTo=`[email protected]`
    
            &emailHtml=`1`
            &redirectTo=`2622`
        ]]


    I've made sure to include these two at the bottom:

    [[!+formit.recaptcha_html]]
            [[!+fi.error.recaptcha]]


    The page with ID 2622 exists and is published.

    Instead when I fill in the form it just reloads the page.

    Here's a link to the form itself:
    http://www.dchgroup.com/search-for-a-home/buying/contact-our-sales-team/

    Feel free to fill it in for yourself and see what happens.

    Thank you very much


      • 22840
      • 1,572 Posts
      Firstly thing to try is moving redirect to the last one in the list for the hooks as they need to execute in order and the redirect should be last
        • 50190
        • 6 Posts
        Hi Paulp

        The redirect hook was originally the last one but I moved it first as part of my debugging. I shall move it back.

        Unfortunately it didn't work however.

        Thanks for the response!
          • 22840
          • 1,572 Posts
          It's working for me

          your thankyou page is contact-us/thankyou
            • 3749
            • 24,544 Posts
            FYI, when redirect is the last hook (as it should be), if any of the previous hooks returns false or fails, no hooks beyond it on the list will execute.
              Did I help you? Buy me a beer
              Get my Book: MODX:The Official Guide
              MODX info for everyone: http://bobsguides.com/modx.html
              My MODX Extras
              Bob's Guides is now hosted at A2 MODX Hosting