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.

Multiple Thank You Page Options based on Checkbox Input

  1. Hello,

    I am looking for some help on redirecting a user to a specific thank you page based on a selection they make in a form. For example, there are certain cities listed in the form. When the user hits submit, I want them to be redirected to a page where they can fill out an appointment form. There will be different appointment forms for each city, so I wanted to see if there was a way in which Gravity Forms could read which dropdown item they chose and redirect them to the accompanying page after they submit their form entry.

    Let me know if this would be possible or if I need to explain it further.

    Thomas

    Posted 13 years ago on Thursday February 10, 2011 | Permalink
  2. HI JT,

    Might I suggest you could actually use one form for all cities but pass the city field to that form (invisibly via parameter) and trigger a completely different set of options for each city (or other situation).

    To see an example of this that I just created you can look at:

    https://lmnopnyc.org/contact (this is the raw form. Note the drop down for attention)
    https://lmnopnyc.org/contact/?attention=Friend (Att: preselecting Become a friend)
    https://lmnopnyc.org/contact/?attention=Sponsorships (Sponsorhsips)
    Etc...

    In your case the dropdown would list the cities and be visible only to Admin but it would
    be used to create conditional logic to display the correct appointment info/fields for each city and you would also create notifications so each city would send an email to the correct party.

    The benefit of this approach is you only have one form to maintain (and export data from) and the URL parameters are pretty easy to remember so you could paste them into email newsletters etc...

    Best,
    Dimitry

    Posted 13 years ago on Thursday February 10, 2011 | Permalink
  3. Hi Dimitry,

    That's the solution that I would have loved to use, but I don't think it will work with Booking Calendar. That's the booking form that I will be setting up for the appointments, and while that booking plugin does support form fields, it doesn't have support for conditional logic (as far as I can tell). That's why I wanted to see if Gravity Forms could send me to a specific thank you page based on the city chosen, because each booking form will be different for each city.

    Gravity Forms just needs to integrate a booking feature. That will fix all my woes. :)

    Any further ideas?

    Posted 13 years ago on Thursday February 10, 2011 | Permalink
  4. Hey Thomas,

    By using the "Pass Field Data Via Query String" under redirect option you shouldn't you be able to send the user to different pages for each city as you planned? I'm implementing Events Calendar with bookings myself on the same site... will let you know how it pans out.

    Best,
    Dimitry
    @2urn

    Posted 13 years ago on Thursday February 10, 2011 | Permalink
  5. You could also use the first technique mentioned above to simply generate an HTML field with an appropriate "booking" button linking to each cities booking form via invisible parameter. If you integrated that with a nice thank you message the users would hardly notice the extra page/click....

    Posted 13 years ago on Thursday February 10, 2011 | Permalink
  6. Currently conditional confirmation messages and redirects are not a built in feature. It IS a feature we do plan on adding.

    It is possible to do a conditional redirect now, but it requires some custom code to implement.

    - Create a custom PHP page that redirects based on a query string value
    - Edit your form
    - Edit Form Settings
    - Select Confirmation tab
    - Choose Redirect as the confirmation type
    - Enter the full URL to the PHP you created that will handle the redirect
    - Use the query string builder tool to pass the query string value the redirect will check for
    - Save your form

    Now when you submit the form it should pass the query string values you setup to the PHP page you created which would then read that query string value and redirect wherever you want it to go.

    So it's not a built in feature, but it's certainly possible with a little elbow grease.

    Posted 13 years ago on Thursday February 10, 2011 | Permalink
  7. Carl,

    This is great! In the meantime, do you have any sample php redirect code that we could modify?

    Thanks,
    Dimitry

    Posted 13 years ago on Thursday February 10, 2011 | Permalink
  8. mrhoneyfoot
    Member

    Subscribed

    Posted 13 years ago on Thursday February 10, 2011 | Permalink
  9. Here is some information on how to use PHP to redirect to another page:

    http://www.cyberciti.biz/faq/php-redirect/

    You would have to combine this with code that gets the query string value and then most likely use a switch statement to determine where to redirect.

    Posted 13 years ago on Thursday February 10, 2011 | Permalink
  10. mrhoneyfoot
    Member

    @Carl Hancock What would the switch statement look like in the context of gforms?

    @2urn Did you find a solution?

    Posted 13 years ago on Tuesday February 15, 2011 | Permalink
  11. The switch statement has no context to Gravity Forms itself..

    You'd configure your form to redirect to a custom PHP page you create, passing a field value via the query string.

    Your PHP page would get that value from the query string and then you would write a switch statement or an IF statement that redirects to the appropriate page based on that field value.

    If field value is X then redirect to this page
    If field value is Y then redirect to a different page

    This PHP page is one you would have to create, so how you do the code is entirely up to you.

    Posted 13 years ago on Tuesday February 15, 2011 | Permalink
  12. Thanks for the information Carl. I will work building this option in and see if I can get a working solution/example.

    This will definitely be a sweet feature for future releases. :)

    Posted 13 years ago on Wednesday March 9, 2011 | Permalink