PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

Can I add Multiple Confirmation Redirects?

  1. I have about 150+ Sample Databases I am offering my prospective clients. Could I (in theory) create one form with a checkbox, put ALL the different sample list selections in the checkbox and then based on whichever one they select it takes them to a unique confirmation redirected URL? I have been trying to play around with the system and have yet to figure out how to do this. Please let me know. My website is http://www.sendbulkemail.net Thanks in advance!

    Posted 13 years ago on Monday July 5, 2010 | Permalink
  2. Gravity Forms doesn't currently have conditional confirmation redirects as a feature. It is a feature we do plan on adding.

    It is possible to this by creating a custom redirect page that your form redirects to. You would create a PHP page that acts as your custom redirector, set your form up to redirect to this page and pass the form field value you want to redirect based on, and then write code in your custom redirector to redirect to the appropriate location based on the form field value that is passed. This is possible using the built in custom redirect functionality. It's a customization so you would have to write the code to do the actual redirect but Gravity Forms can redirect to your custom page and pass the form field value if you tell it to using the Confirmation settings in the form builder.

    If you are doing a redirect based on a user selection I would suggest using a drop down and not checkboxes. Otherwise if you use checkboxes, they are multi-select so how would you know where the redirect is supposed to go as a redirect would be a one to one relationship?

    Posted 13 years ago on Monday July 5, 2010 | Permalink
  3. Has anyone written a sample PHP script to drive multiple confirmations? We have several products and were trying to just have one eval form with conditional logic. Depending on which product they say they want to eval, we want the form to end up presenting them that download link. Thanks!!

    Posted 13 years ago on Monday January 17, 2011 | Permalink
  4. Given a multiple choice field that is configured like this: http://grab.by/8qpE -- Here is the code that would allow you to make each option have a unique redirect:

    http://pastie.org/1470436

    I've included some notes in the code snippet. Let me know if you have any questions.

    Posted 13 years ago on Monday January 17, 2011 | Permalink
  5. Thanks! I get the logic on that. My form has an extra fork to deal with though and I'm not sure what tos do. Maybe I am trying to do too much with one form. Basically,we offer 1) eval or 2) upload test file. If eval, which product? When they choose, we want them to go to the correct product download page. The PHP that you suggested takes care of that - but, if they choose test file, we want the confirmation to give a text message "Thanks for uploading a test file. We'll get the results back to you shortly". You can see the form on our sandbox site - http://vit-sandbox.com/store/try/.
    Can I do what I want to do?
    Thanks!!

    Posted 13 years ago on Monday January 17, 2011 | Permalink
  6. Yup, pretty easy too! :)

    http://pastie.org/1470865

    We'll keep things simple and assume that by default your form is setup to use a text confirmation. Now the updated code snippet above checks if a format is selected, because if a format is selected you know that they chose the "I'll upload a sample PDF file..." option. If a format is selected, it changes the type of the confirmation to a redirect and then sorts through the rest of the code to determine what the URL will be.

    Good luck! :)

    Posted 13 years ago on Monday January 17, 2011 | Permalink
  7. Bedhead
    Member

    David, When I try duplicating your first example I get the following error after hitting submit:

    Fatal error: Call to undefined function add_filter() in /home/website/public_html/testing/redirect.php on line 4

    I've changed the gform_pre_submission_filter_ value to 1 since it is my only form.

    Any idea?

    Posted 13 years ago on Tuesday February 1, 2011 | Permalink
  8. Quick one. Thanks for the snippets here.

    I've modified this for a simple 'choose URL by select box value':

    // Custom redirect for GF
    function custom_redirect_url($form){
    
        // update the "1" after "input_" to the ID of your field
    	$destination = $_POST['input_11'];
        $form['confirmation']['url'] = 'http://www.mysite.com/' . $destination;
    
        // return the modified form
        return $form;
    }
    add_filter('gform_pre_submission_filter_2', 'custom_redirect_url');

    For some reason the destination URL always comes out with a question mark (?) at the end. Any ideas?

    Cheers,

    David

    PS I know, lots of posts recently - thanks for your responses. FWIW I'm selling lots of developer licenses for you!

    Posted 12 years ago on Wednesday September 21, 2011 | Permalink
  9. Gravity Forms may be adding the question mark on the end because the confirmation redirect option typically includes query string parameters that come after the question mark.

    Posted 12 years ago on Wednesday September 21, 2011 | Permalink
  10. Hi David,
    Thanks for your help on this a while back. We are about to go live with the new site and I still have a problem with this redirect. I am getting:

    Fatal error: Call to undefined function add_filter() in /home/vitsandb/public_html/wp-content/themes/vi/gform_redirect.php on line 3

    Can you please take a look and let me know what you think? If you want access to the site, I can give it to you - just email jean at visual-integrity.com.

    Thanks a million!!

    Posted 12 years ago on Sunday March 25, 2012 | Permalink
  11. I'm still wrestling with one form before we go live. Can someone please help me? I have exported for form and can send it along with the redirect.php file. It will make a good example for others of a conditional redirect once it works. I'm sure it's something small that you guys will figure out in a heartbeat. The form is processing/submitting but not giving me the confirmation page. Thanks so much!

    Posted 12 years ago on Thursday March 29, 2012 | Permalink