Can I supply a url param for the redirect on submit?

  • andrew_codeorg
    Asked on May 24, 2018 at 5:08 PM

    We are embedding a JotForm on our website and need to redirect back after submission so we can display additional messaging and control the flow on our website. 

    Ideally we'd like to test this before deploying to production, which means we need to control where we redirect. I've set this up with an environment url param (hidden field) and conditions on that, but it's still very limited because each form needs to know about all our different environments and have all these conditions.

    Is there a way we can just send a redirect url to our embedded form? This would be much simpler, more testable, and more flexible. I've tried setting the redirect to "{submitRedirect}" and it doesn't expand.

    Thanks,
    Andrew
    Code.org

  • jonathan
    Replied on May 24, 2018 at 6:17 PM

    I think what you are looking for is the Redirect URL conditions of the form.

    1527200050zzz 2018 05 25 06 Screenshot 10


    You can use URL param value in the conditions redirect URL.

    Example:

    1527200240zzz 2018 05 25 06 Screenshot 21

    1527200101zzz 2018 05 25 06 Screenshot 32


    I hope this help. Let us know if you need further assistance.

  • andrew_codeorg
    Replied on May 24, 2018 at 6:24 PM

    Thanks, but I don't think I explained right. I am already using those conditions and they are insufficient.

    What I want to do is pass the entire url in a param.

    With these conditions, I still need the base URL (in your screenshot the "https://www.jotform.com/?message=" part) to be hardcoded in the condition, and I need to add one of these conditions for each environment (dev, test, prod). It works, but it's limited, error prone, requires a lot of maintenance, and is harder to test.

    Is there a way to redirect to a custom url from a param, open ended, without conditions and hardcoding parts of it?

    Thanks

  • jonathan
    Replied on May 24, 2018 at 7:55 PM

    Is there a way to redirect to a custom url from a param...

    Can you describe more where you intend to get the custom URL value from?

    From what I understand, it could be from a field in the form... i.e. field_1  = https://www.customURL.com

    If it is, you can use the field ID in the redirect URL also. Either using redirect conditions or just the Thank You page redirect option.

    Ex:

    1527206099zzz 2018 05 25 07 Screenshot 10




  • andrew_codeorg
    Replied on May 24, 2018 at 8:20 PM

    Right, I want the custom url to come from a field in the form. The problem is I need to supply the *entire* redirect url, not just a param. The most important part in this case is the base url, the "https://www.jotform.com/?full_path_redirect=" in your latest screenshot, which is hardcoded. 

    For more context, I want the following environments to work at a minimum for each form we create:

    1. development. This should redirect my browser to my local server on http://localhost/...
    2. staging. This should redirect to https://staging.code.org/...
    3. test. This should redirect to https://test.code.org/...
    4. production. https://code.org/...

    Earlier, when I tried to substitute {field_1} for the entire url it didn't work. However I just tried it again, and it did work :) So, never mind. Sorry for the confusion, and thanks for your help.


  • Kiran Support Team Lead
    Replied on May 24, 2018 at 11:20 PM

    Glad to see that the issue is now fixed for you. Please do not hesitate to get back to us if you need any further assistance. We will be happy to help. 

    Thank you for using JotForm!