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.

Conditional Redirect

  1. Please review http://www.gravityhelp.com/forums/topic/conditional-redirects-1

    I would like to do the same thing. Here is my form:

    http://campbovay.org/onsite-registration/

    I would like to either display a custom graphic (map to camp location) or redirect to a different page based upon the value selected in the "Unit Number" dropdown.

    Posted 12 years ago on Saturday October 13, 2012 | Permalink
  2. You will have to do this in your functions.php file with a bit of code. You can use the form_confirmation filter to change the redirect URL:

    http://www.gravityhelp.com/documentation/page/Gform_confirmation

    Take a look at this code and see if you can extend it for your application. I used your form ID and field ID and the unit values from your drop down. Please check to be sure it's all accurate though. http://pastebin.com/XrnfSatx It's untested, but should work and is an example of how to return a different redirect URL for every value in your drop down.

    Posted 12 years ago on Monday October 15, 2012 | Permalink
  3. studio57designs
    Member

    Chris, digging up an old topic here....but, did not know rather to reference it in a new post or just add here.

    How would I do a range in the example code you provided? I have it working in my form....but, there are ranges:

    28-45 - send to page 1
    56-62 - send to page 2
    63-80 - send to page 3
    81-84 - send to page 4

    I know I can list each individually, but is there an easier way?

    Thanks,
    Louise

    Posted 11 years ago on Thursday April 25, 2013 | Permalink