Can I prepopulate a form based on responses in another form?

  • cobbkenneth
    Asked on January 27, 2015 at 2:34 PM

    I have a form that contains five checkboxes in a particular field.  When the user clicks submit, it will redirect them to a second form which has the same checkboxes, and I'd like the same boxes to already be checked based on the first form.  I know how to pre-populate using a URL which contains the values, but can I set variable values in the URL based on what is entered in the first form?

  • Ben
    Replied on January 27, 2015 at 4:12 PM

    Can you please give us a bit more details in regards to this part:

    can I set variable values in the URL based on what is entered in the first form

    At first I thought that pre-populating over URL is what you were after, but as you say that you know how to do it followed by the section above I am not quite sure what is the issue.

    If you can explain or give us an example of what you would like to accomplish and we would be happy to assist in setting it up.

  • cobbkenneth
    Replied on January 27, 2015 at 4:24 PM

    OK, I have two forms setup:

    EE Product Selection (Short)

    EE Product Selection (Long)

    I have the "thank you page" for SHORT redirecting the user to the URL for LONG.  What I am looking to do is to add some code to this URL so that if someone checks the "Home / Renters" checkbox on the SHORT form, the "Home/Renters" checkbox on the LONG form will be pre-checked when they are re-directed there.

  • Ben
    Replied on January 27, 2015 at 5:44 PM

    OK, so you would need to pre-populate them over the URL. To do this you could use this:

    http://www.jotformpro.com/form/50266513671958?input3[1]=1 (you will see that the option is now selected). Do note however that this is just a very simple example to show you how it gets checked.

    If you do this: http://www.jotformpro.com/form/50266513671958?input3[1]=0 it will not be checked.

    Now this option: http://www.jotformpro.com/form/50266513671958?input3={input3} would work great if we allow only one option to be selected, but if there are multiple options allowed (which usually are for checkbox we need to do the following:

    http://www.jotformpro.com/form/50266513671958?input3={input3:0},{input3:1},{input3:2},{input3:3},{input3:4}

    This will list all of them one after another, but only if they are selected. Now you must add the commas into the URL as well in order for them to work properly, but if they are not selected, only the comma would show, so you might end with few commas in the URL, but the jotform will still function normally.

    Do let us know if that helps you achieve what you are after.

  • cobbkenneth
    Replied on January 27, 2015 at 6:18 PM

    Thank you.  That is exactly what I needed to do.  You guys are awesome!

     

  • Kiran Support Team Lead
    Replied on January 27, 2015 at 7:55 PM

    Glad to see that the issue is resolved for you. It's our pleasure to assist you.

    Please do not hesitate to get in touch with us if you need further assistance. We will be happy to help.

    Thank you for using JotForm!

  • cobbkenneth
    Replied on November 14, 2015 at 2:46 PM

    As an aside for my (and other people's) use, after trial and error, I discovered that the checkbox text has to be the same on both forms in order for this to work.

  • Kevin Support Team Lead
    Replied on November 14, 2015 at 8:22 PM

    Hi,

    Thank you for sharing us that, this information will help us to assist better the JotForm users.

    Regards.