How to use the Save and Continue Later feature and pass the session variable to a form embedded in a website?

  • DTSS
    Asked on March 21, 2016 at 10:49 PM

    I have read and followed this thread already and done exactly what it says here to the best of my ability: https://www.jotform.com/answers/103105-Security-of-Form-using-the-How-to-Continue-your-form-later-guide-Session-Multiple-Upload-Problem

    And this gets me a 404 error message.

    Please give me the specific url to forward them to so they land on my site, not on a blank JotForm page to complete their form.

     

    Thanks,

    Mark

  • Kevin Support Team Lead
    Replied on March 21, 2016 at 11:50 PM

    This is possible to achieve by using PHP variables in your website, if the server where you hosted your website runs PHP then you are able to pass variables through URL, I have tested using the session method that works with the Save and Continue Later feature, but unfortunately it does not work when you embed the form in a website, now this workaround may help you. 

    First, you will need to embed your form using the default method: http://www.jotform.com/help/34-Adding-a-Form-to-a-Web-Page.

    I have tested using the iFrame method and it does not work, it only will work using the defualt Javscript code.

    Now you will need to capture the value in the URL that goes to the website where is embedded your form, a change that you will need to do is save the page with the extension .php instead of .html, in order to get the PHP code working fine. 

    The code that you need to embed in your website should look like this: 

    <?php

      $email = $_REQUEST["email"];

    ?>

    <script type="text/javascript" src="https://form.jotform.com/jsform/60807147175962?session=<?php echo $email; ?>"></script>

    Notice that I'm passing the value to the form in the URL of the embedded code. 

    The final URL should look like this: https://www.dtss.us/files/enrollment.php?email=sample@mail.com. 

    Where the file is .php and the variable that you are getting is $email, then you may take this URL and simply paste it in the thank you page or email autoresponder, replace the sample email and add the variable that comes from the submission. 

    Hope this helps.