What is JotForm?
JotForm is a free online form builder which helps you create online forms without writing a single line of code. No sign-up required.

At JotForm, we want to make sure that you’re getting the online form builder help that you need. Our friendly customer support team is available 24/7.

We believe that if one user has a question, there could be more users who may have the same question. This is why many of our support forum threads are public and available to be searched and viewed. If you’d like help immediately, feel free to search for a similar question, or submit your question or concern.


  • Profile Image

    Can a form be pre populated with data from a previous submission just moments ago?

    Asked by richp on May 10, 2011 at 02:36 PM

    I have a multi page form.  The first page is the personal information about the form filler.  The latter pages are details about a specifc item.  I'd like to redirect, after submission, to a page offering the ability to create 2nd submission, but I would like page 1, the personal information, to be pre populated.  I'd be open to any suggestions of a work around if this is not possible.

    Page URL:
    http://www.jotform.com/?formID=11281812243

  • Profile Image
    JotForm Support

    Answered by NeilVicente on May 10, 2011 at 07:36 PM

    Hi,

    To achieve this, you would need to do some custom PHP scripting.

    First you need to enable sending HTTP POST data:

    1.  Go to Setup & Embed
    2.  Click on Preferences button
    3.  Click Advanced Settings tab in the Preferences window
    4.  Select "Yes" in Send Post Data field

    5.  Click Close Settings then save your form

     

    Next you would need to create an intermediary PHP page that will act as a bridge between the two forms. What happens is it will parse submitted POST data from the first form then prepopulate the second form using URL Query Strings

    Take a look at this Sample Form I created

    Here is the source code for the PHP page I used to prepopulate the fields in the second form: http://pastie.org/4659817

    Feel free to modify that file for your own use. Learn more about PHP in this website

     

    Hope you find this information useful. Feel free to ask more questions. Thank you for using Jotform.


    Neil

  • Profile Image

    Answered by richp on May 10, 2011 at 07:44 PM

    Thanks Neil.  Unfortunatley, I'm trying to do this on a google site and from what I can gather, PHP is not supported with a google site.  Is that the case to the best of your knowledge?

  • Profile Image
    JotForm Support

    Answered by NeilVicente on May 10, 2011 at 07:49 PM

    Well, I don't really think there is a workaround other than this. You might want to get a paid hosting that supports PHP. To my knowledge, there are a few free PHP hosting that are available, but they are hard to come by. Try googling for the keywords "Free PHP Hosting". Good luck!


    Neil

  • Profile Image

    Answered by richp on May 10, 2011 at 08:26 PM

    Neil,

    Pardon me if I sound like dummy but I'm not very knowledgeable in this area.  But what if I bounced the form filler to another site I own that does support PHP.  In otherwords, they fill out form 1, which has the information to post and is on the original site.  Then I use another site all together for the bridge.  Am I crazy?  Does the bridge have to be in the same domain as the forms?

  • Profile Image
    JotForm Support

    Answered by NeilVicente on May 10, 2011 at 08:40 PM

    As long as you use iFrame embed code for your first form, you're good to go. The first form will load inside the iframe on your Google site, then will call the bridge (php page) on your other domain. The bridge will then call and prepopulate the second form but will not load it inside the iframe. Instead it will be loaded on the window itself.

    What you can do to keep the 2nd form from taking over your entire page is to embed using the form's source code and then instead of using the 2nd form's direct url for the bridge to call, it will call your Google page's url that contains the 2nd form's source codes.

    I hope I'm making sense with all these words. I'd have to say that this is such a complicated subject. Let me know if you need anything else.


    Neil

  • Profile Image

    Answered by kristianmeiswinkle on November 02, 2011 at 03:56 PM

    This looks like it could be the solution to my problem. But how do I bridge the pages using iframe? My iframe points to the form i need filled, then i want it to go to a secondary form with prefilled information from the first form. I understand i create a page to run the php script but how do i both use the iframe to pull my jotform then go to the php script page?

  • Profile Image
    JotForm Support

    Answered by Mike_T on November 02, 2011 at 06:00 PM

    You can use a Custom URL option for Thank You page to redirect your form to the php script.

    Please feel free to clone Neil's form: https://www.jotform.com/NeilVicente/11231828239 to see how he made it.

    Thank you for using our services.

  • Profile Image

    Answered by barq on September 04, 2012 at 02:37 PM

    Really interesting topic!

    Sorry for my ignorance, but I'm not sure I understand how to:

    1. customize the PHP to fit my forms

    2. avoid that the visitors sees this temporary load page, in Neils example. I don't want the visitors to think I'm redirecting them to an extra page (if they think it's something ad related or some scam). Can't I avoid this page load page, so the visitors only experiences the two form pages and the temp page is loaded in an invisble iframe or something.

    I'm trying to link this:

    Get a consultation form: barqvideo.com

    To this contact form: barqvideo.com/contact.

    Anyone knows how to accomplish this with the PHP script and avoid the temporary transfer page (or 2nd best, make it seem part of my website)?

  • Profile Image
    JotForm Support

    Answered by NeilVicente on September 04, 2012 at 03:03 PM

    @barq

    1. customize the PHP to fit my forms

    It would require PHP knowledge to customize the script, and since the forms are embedded on your website, implementing this would be much more complicated than the usual.

    Here's a PHP reference which might help you:

    http://www.php.net/manual/en/

    2. avoid that the visitors sees this temporary load page, in Neils example. I don't want the visitors to think I'm redirecting them to an extra page (if they think it's something ad related or some scam). Can't I avoid this page load page, so the visitors only experiences the two form pages and the temp page is loaded in an invisble iframe or something.

    The intermediary PHP page is required to make this work, so there is no way to avoid the temporary load page.

  • Profile Image

    Answered by barq on September 05, 2012 at 04:19 AM

    Hi Neil,

    Thanks for your answer! I have some more questions:

    1. It's only the form 1 that's copied into the website (this was done as some CSS styles on my website were overwriting the form styles.). The receiving contact form is embedded with an iframe on the barqvideo.com/contact page. Wouldn't it be able to receive like that, if I just refer to the embedded form URL (http://form.jotformeu.com/form/21572166867361)? Or is it still a problem?

    2. I'm not sure if how I have altered the script is correct, but shouldn't this work?

    <?php

    $answers = $_POST;

    $url1 = "http://form.jotformeu.com/form/21572166867361?";

    $url2 = "name19=".$answers[name19]."&email=".$answers[email];

    header("location:$url1$url2");

    ?>

  • Profile Image
    JotForm Support

    Answered by NeilVicente on September 05, 2012 at 08:42 AM

    @barq

    1.  The second form is also embedded on your site using iFrame. That exact page (http://barqvideo.com/contact) should contain the PHP script which will prepopulate the embedded form.

    2.  No, I don't think that would work for your situation. That script will redirect to the standalone form instead of calling the form from your contact page.

    I am not sure if I can help you with a custom script as I don't have a WordPress installation on my end - I will not be able to test how a PHP script will interact with your WordPress page.

  • Profile Image

    Answered by barq on September 05, 2012 at 09:38 AM

    Hi Neil,

     

    Thanks for you answer. Would it work if I gave you access to my Wordpress installation?

  • Profile Image
    JotForm Support

    Answered by NeilVicente on September 05, 2012 at 09:54 AM

    @barq

    I will try on my idle time but I can't promise anything. Open a new thread and I'll set it to private mode. Afterwards, provide me access credentials to your WP site.