How to make a form work with a second form?

  • Profile Image
    Twilightwarrior
    Asked on August 08, 2012 at 09:33 PM

    Hello, 

    I would like to make it so that this form http://form.jotform.ca/form/22206404194243 and this one http://form.jotform.ca/form/22207029801242?__jsonlib_toJSON=function+%28%29%7Breturn+this.valueOf%28%29%7D 

    are related. 

     

    I want to make it so that if a person fills out form A and form B, that the content sent from form A will be related to B. If you visit my forms and go through them, you will see what I mean. 

    If John visits form A and submits it and then visits form B and submits it, the content should somehow be related so I can find out who sumbitted form B (which does not ask for any identifiable info). 

  • Profile Image
    jeanettebmz
    Answered on August 09, 2012 at 12:06 AM

    Here it is a workaround that might accomplish what you are looking for

    I will call your 2 forms hereinafter Forms 1 and form 2.

    What you need to do is make Form2 be the Thank You page of Form 1 .

    The submission button text of Form 1 should be changed to "Next" or “Continue” or something similar , to give the illusion to users that they are completing just one form. The only problem would be the absence of a "Back" button, but you could always include an autoresponder with an edit link for each form.

    Here's the process in detail:

    1. Have 2 forms created (you already did this) preferably with identical styling to preserve the illusion

    2. In Form 1, click the "Submit Form" button and change its text to "Next" 

    3. Go to the "Setup & Embed" tab, click "Thank You", select Custom URL  and click on Next

    4. Enter the URL of the second form, click "Finish" and save the form

    5. (Optional) In the same form1, create an autoresponder and include an edit link 

    6. For Form 2, repeat steps 2 to 5

     

    Best regards

    Jeanette

  • Profile Image
    Twilightwarrior
    Answered on August 09, 2012 at 12:30 AM
    Seeing that I have no personal fields in the second form how will be content from form one become related with the content from form 2?If both John and Fred make an order and John completes form one and two but Fred completes only form one how will I know if the submission of form two belongs to John? Since no personally identifiable information is found in form two, from what I understand this would be impossible correct?
  • Profile Image
    fxr
    Answered on August 09, 2012 at 05:15 AM

    One idea could be embed the 2nd form on a php enabled webpage, and use the post vars from the first form to populate (hidden fields) on the 2nd form.

    Heres my first form design:

    I follow this guide to help work the POST variable names of each of the fields on my form. 

    I can then assign variables to each of the values on this form with this php.

    $text1 =  $_POST['text1'];

    $text2 =  $_POST['text2'];

    $email =  $_POST['email5'];

    --

    Now, to make use of these variables to prepoulate fields on a second form. 

    Form design: 

    I use this guide to help create a URL to prepopulate the fields in this form:

    Tip: A quick way of getting the URL parameters to prepopulate form fields is to check for the variable names in the email composition.

     

    So, I can build a test URL to my 2nd form that prepopulates each of the fields on it (including the hidden one) with 

    http://form.jotformeu.com/form/22212635393348?text11=test&text24=test2&hiddenEmail5=test@test.com

     

    Now, all I need to do is pull the variables names from the post vars on the php page used as the 'thankyou' page for my first form and build a URL to prepopulate the second form with them.

    I will use my script embed code for my 2nd form. 

     

    The php/HTML needed to convert the post vars from the first form and create a prepopulate URL for the 2nd with them would look like this:

    $text1 =  $_POST['text1'];

    $text2 =  $_POST['text2'];

    $email =  $_POST['email5'];

    <script type="text/javascript" src="//form.jotformeu.com/jsform/22212635393348?text11=<? echo $text1; ?>&text24=<? echo $text2; ?>&hiddenEmail5=<? echo $email; ?>"></script>

    --

    Thats pretty much it. 

    Here is a working example: -> http://form.jotformeu.com/form/22212396749357

    --

    Screenshots of testing:

    Form 1:

     

    Upon Submit to form 2:

    And my email alert when form 2 gets submitted:

     

    --

     

    Here is a link to the entire php/HTML code used for form2.php which is the Custom URL thankyou page for form 1 -> http://pastie.org/4426236