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 I pre-populate the data of my webform?

    Asked by habhab on November 01, 2013 at 01:56 PM

    Hello,

    I have included a JotForm in my website. I have redirected the 'thank you' link to my own myscraper.php page, where using $_POST data the values that have been submitted are displayed as a kind of a summary. On this page, you can press a button to submit the selections (which will be an email sent from my webhost), or a cancel button that brings the user back to the form page.

    Something I didn't realize is that the form is completely empty when the user presses cancel. This means that the data has to be filled in again.

    Is there a way to pre-populate the form with values? I haven't tried it yet, but am I correct to assume that each element in the form has an ID="input_XX", which means that through some JavaScript I can use "document.getElementByID({elementID}).value" to set the value? Is that the way to do it?

    Thanks,

    Hans

    JotForm email thanks hello
  • Profile Image
    JotForm Support

    Answered by ashwin_d on November 01, 2013 at 02:51 PM

    Hello Hans,

    If I understand your requirement correctly, your requirement is to be able to simply pre-populate your form with value. Is that correct?

    Yes you can obviously use getElementById to populate the fields with some values but there is a better and uncomplicated way to pre-populate your form. You can use our url parameter feature (very similar to query string) to achieve your requirement. Here is a guide which should help you:  http://www.jotform.com/help/71-Prepopulating-fields-to-your-JotForm-via-URL-parameters

    Hope this helps.

    Do get back to us if you have any questions.

    Thank you!

  • Profile Image

    Answered by habhab on November 01, 2013 at 03:31 PM

    Hello,

    Thanks for the quick reply. The information was very usefull. I'm just relatively new in webdesign, and I am struggling with the mix of HTML, CSS and PHP.

    I was able to use a JotForm on a webpage. When the user presses submit, he is thrown on a page that shows a summary table of all the values he entered (using $_POST variables with a user defined URL for 'thank you' page).

    This page contains a 'CANCEL' button. I can let this button launch a JavaScript function, which works fine because it can show the "Alert('Cancel pressed');" message. Question is now how I can make this function launch the page that has the form, including the ?paramater=value added to it. The parameters reside in $variables which are PHP code. But can I add this in JavaScript code? So it basically means that I need to let my JavaScript function launch a webpage like "mywebpage?parameter1="+$value_parameter1... 

    And if that doesn't fly, basically I want the following workflow. Maybe you have a better approach?
    - fill in the JotForm form in the formpage
    - when submitting, show a page (or popup - whatever) that lists the values and asks for a confirmation
    - if 'confirm' is pressed, an e-mail is sent with the data
    - if 'cancel' is pressed, the same formpage is shown pre-populated with the values that were entered, allowing the user to edit them

    Pretty simple, isn't it? :-)

    Thanks,

    Hans 

  • Profile Image
    JotForm Support

    Answered by KadeJM on November 01, 2013 at 05:03 PM

    I think I partially understand where you are trying to go with this but I can see where this would become problematic when posting data to the thank you page which may then possibly become a bit confusing. Using Custom JS and JQuery controllers is possible but you need to be careful on how you implement these since they can otherwise conflict with our form's library causing unexpected problems.

    I think as an alternative thought on this it might be a better approach to turn your Form into a Normal Form with just a Confirmation Page to then Display a User's Answers before Submission. You could then probably more easily attach buttons to it to Confirm and send your Email or Cancel and redirect back to the Populated Form through an hidden Edit-Link that was generated at the time of cancellation. You can refer to this guide here http://www.jotform.com/help/98-Confirmation-Page-Tricks for more information. This is just a suggestion and my opinion though.

  • Profile Image

    Answered by habhab on November 02, 2013 at 08:05 AM

    I have followed the instructions that you gave me, and they seem just to work fine. But what I don't like is that when the user presses the 'submit' button in the form, which now directs him to the Confirmation Page, a submission is already being sent! I would expect that the submission only is sent when the user submits in the Confirmation page.

    The current behavior is:

    1) eating up my submissions dramatically (can't developers get some free submissions?)

    2) on the receiving side, I receive submissions that are irrelevant because they are not confirmed by the user

    Next to that I have another question on the instructions you gave me. At the beginning it says: "copy the string of digits at the end of the form's URL" from the preview page. But that string of digits is never used in your instructions. Or do I have to replace the {edit_link} with this?

    I feel that with a few more instructions from your side, things will just be perfect. I have tried several form generating tools, but JotForm is really sticking out as being the best looking and most versatile product so far! (can I get 10 free submissions for this? :-))

  • Profile Image

    Answered by Cesar on November 02, 2013 at 02:48 PM

    Hello habhab, 

    It's great to hear you are enjoying JotForm's service.

    In regards to the confirmation page trick. Unfortunately this is how the workaround for confirmation works at this time. A submission will be made initially, and a second one will follow once the user confirms his information. At this time there is no way around that process. 

    In regards to the second point,

    On Step 4 of the Confirmation-Page-Tricks page mentions that you need to add the last digits of your forms URL to the area that is shown underlined in red, effectively replacing the http://www.example.com from the code.

    https://shots.jotform.com/elton/jotform-10-22-2013-15-55-04.png

     

    Do let us know if you need further assistance. Thank you again for your input.

  • Profile Image

    Answered by habhab on November 03, 2013 at 02:25 AM
    It's a pitty that the submissions are sent more than once, which is really an enoying issue. I hope that it can be solved soon. In the meantime, I'm thinking of a workaround, but not sure if it will work. I would use the "thank you page" that is addressed when the "complete submission" button is pressed (the "http://www.example.com" in your above screenshot), and use $_POST variables to.extract the form data and generate my own e-mail. I just hope, when I enable POST in your form, that this data will be sent to that page. In my implementation, I will need to do that anyway, because I need additional info that is not available in the form to be sent with the email.Brings me to your last remark, about copy-ing the string of digits. I disagree with you, because the explanation says clearly: ***Make sure to change the "http://www.example.com" in the code to the address an actual "Thank You" page on your web site.This are NOT the digits, but the "thank you page" you have to put there. And this is also what I did, and it works fine. I never had to use the digitis. I suggest you check this with the creator of this 'trick'.
  • Profile Image

    Answered by habhab on November 03, 2013 at 02:28 AM
    Hahahaha, you're damned fast!!! I see you have already updated the http://www.jotform.com/help/98-Confirmation-Page-Tricks? So i was right, :-)
  • Profile Image
    JotForm Support

    Answered by EltonCris on November 03, 2013 at 08:36 AM

    @habhab 

    Yes, you're definitely right. Step 2 isn't necessary because I have updated the script that uses {edit_link} tag anymore. Unlike previously, the first code was like this: http://submit.jotformpro.com/form.php?formID=31362999175971&sid=249294852242594801&mode=edit, (this is the edit URL that was part of the code before) the bolded part is supposed to be your formID that was mentioned on step 2. But not anymore, I have updated the guide to avoid confusion.

    Thanks for bringing this to our attention. Cheers!

  • Profile Image

    Answered by habhab on November 04, 2013 at 07:21 AM

    Where can I find more info about "prepopulate.jotform.io"?

  • Profile Image

    Answered by gori-mathew on November 04, 2013 at 07:41 AM

    Hi,

    As suggested by Nicholas for the application please go to this link: http://prepopulate.jotform.io There is a  video guide on the link to guide you through the whole process.

    Do let us know if you need further assistance.

    Thanks!