We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 48586
    • 78 Posts
    I just installed formit2db, and after a little work I have it writing to a specific table perfectly. However, my redirectTo is no longer working on a successful form submission. My formit code looks like:

    [[!FormIt?
        &hooks=`spam,email,redirect,formit2db`
        &prefix=`refer_`
        &tablename=`a_friend`
        &packagename=`refer-a-friend`
        &classname=`afriend`
        &emailTpl=`referaFriendEmail`
        &emailSubject=`Submission via Refer a Friend form`
        &emailTo=`[email protected]`
        &emailFrom=`[[+r_email_address]]`
        &emailFromName=`[[+r_first_name]] [[+r_last_name]]`
        &redirectTo=`1172`
        &validate=`r_first_name:required:minLength=^2^,
        r_last_name:required:minLength=^2^,
        r_account_number:required,
        f_first_name:required,
        f_last_name:required,
        smallBusiness:required,
        f_company_name:required,
        f_address1:required,
        f_city:required,
        f_state:required,
        f_zipcode:required,
        f_home_phone:required,
        f_work_phone:required`
        ]]


    Am I missing something simple here? Thank you.
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      I suspect that it's the hook order. You shouldn't redirect until everything else is done, although that should pre-empt the formit2db hook. But it's worth a try, anyway.
        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
        • 48586
        • 78 Posts
        Quote from: sottwell at Jun 12, 2015, 01:24 AM
        I suspect that it's the hook order. You shouldn't redirect until everything else is done, although that should pre-empt the formit2db hook. But it's worth a try, anyway.

        My original order was:

        &hooks=`spam,email,formit2db,redirect`


        and I just reset to that, still no luck with redirect. I even created a new resource to use as redirectTo, hoping it would just need a new resource id, but no luck with that either.
          • 4172
          • 5,888 Posts
          is your formit2db - snippet - code the original one?

          does it have a

          return true;


          if successfull
            -------------------------------

            you can buy me a beer, if you like MIGX

            http://webcmsolutions.de/migx.html

            Thanks!
            • 48586
            • 78 Posts
            Quote from: Bruno17 at Jun 12, 2015, 03:08 AM
            is your formit2db - snippet - code the original one?

            does it have a

            return true;


            if successfull

            It does at the last line