I need to create a redirect URL which includes variables in the address

  • hilltopkennels
    Asked on January 2, 2016 at 6:30 AM

    Ideally I'd like to create a URL from field values within a Jotform form, then use the created URL as a redirect, is this possible (I've shown sample field names in RED)?

    i.e. 

    https://secure-test.worldpay.com/wcc/purchase?InstId=123456&cartId=WorldPay+Test&amount=&{FullPayAmt}&currency=GBP&desc={BookingRef}&testMode=100

    Unfortunately my website host doesn't support PHP so I can't use the POST method.

    Thanks,

    Simon

     

  • Boris
    Replied on January 2, 2016 at 11:28 AM

    Yes, you can definitely use the name of the field on your form as a value of URL parameters on the Thank You page. So the first thing you need to do is get the proper field names, which judging by the link you have provided in your example you already have:

    How to find Field IDs & Names

    When you have the names of your desired fields, which in your example seem to be {FullPayAmt} and {BookingRef}, you need to set your own custom URL as the Thank You page. The Thank You page URL is where the form will be redirected to upon submission:

    Setting Up the Thank You Page - part under "Redirect To Page (Custom URL)"

    So you can set your desired URL as the Thank You URL. As a demonstration, I have set it to http://example.com/?param1={fullName}&param2={email} in the following image:

    I need to create a redirect URL which includes variables in the address Image 1 Screenshot 30

    Upon submission, I was redirected to http://example.com/?param1=Boris%20Test&param2=support@jotform.com where Boris Test and support@jotform.com are values entered in those fields.

    I need to create a redirect URL which includes variables in the address Image 2 Screenshot 41

    There are three things I would like to point out though.

    1, you seem to have a superfluous & character separating the actual amount variable from the amount parameter in your example above. Please remove it, so that this:

    https://secure-test.worldpay.com/wcc/purchase?InstId=123456&cartId=WorldPay+Test&amount=&{FullPayAmt}&currency=GBP&desc={BookingRef}&testMode=100

    Becomes this:

    https://secure-test.worldpay.com/wcc/purchase?InstId=123456&cartId=WorldPay+Test&amount={FullPayAmt}&currency=GBP&desc={BookingRef}&testMode=100

    2, if any of the values are not correctly passed inside the URL, which usually happens only on Text Area fields and other fields where data is entered in multiple lines, you may need to use the URLENCODE option in your variables, such as this: {URLENCODE:BookingRef}

    How to Pass Values to the Text Area of a Form via URL encoding.

    3, in your example you seem to need to use + character as a space encoded character, while we pass space characters as an actual URI representation of a space character (%20) and not a plus character. Depending on how the custom URL parameters work on WorldPay, this may cause an issue to be aware of.

    Please test it out and let us know if you need any further assistance, we will be happy to help.