How can I 'pre-fill' form fields?

  • MatthewHomer
    Asked on November 19, 2015 at 8:53 AM

    I am using JotForm to collect door to door household data. I want certain fields (road name, for example) to be prefilled by the surveyor, so they don't have to add this data at every household.

    Can I do this, or is there a field that defaults to previously used entries, for example?

    Thanks.

    Matthew.

  • Mike_G JotForm Support
    Replied on November 19, 2015 at 11:30 AM

    If I understand your concern correctly, you would like to have a form, that will be filled up by a surveyor. The surveyor's details will be entered once for the first survey entry and the form will be prefilled with the details of the surveyor for the second, third, fourth and so on... entries, is that correct? Unfortunately, we don't have a field that can remember your entry from a previously submitted form but, there is a workaround.

    I have created a sample form and here's how it works:

    First, the surveyor will enter his details for his first survey entry. Upon submitting the form, the surveyor will get a confirmation message through the Thank-You page. Aside from the confirmation message, the surveyor will have the option to make another survey entry with his/her details (pre-filled on the form) or he/she can also choose to start from scratch.

    Here's the Sample Form URL: https://form.jotform.com/53224421934955

    Note: On the First entry, the surveyor is required to enter his/her information before he proceeds with the first survey.

    I suggest you clone the sample form and make a test submission.

    Here's how it's done.

    Suppose you already have a survey form.

    How can I pre fill form fields? Image 1 Screenshot 70

    Once you have the form already, you can now create the link that will redirect surveyors to the form with the details that they have entered the first time.

    What you need is the link to the form or the Form URL. 

    How can I pre fill form fields? Image 2 Screenshot 81

    Then, the name attribute of each input field the surveyor needs to fill in with his/her details.

    This guide will be very helpful for you to learn how to get the name of the fields: Prepopulating-fields-to-your-JotForm-via-URL-parameters

    And lastly, you need to have the {fieldNames}

    How can I pre fill form fields? Image 3 Screenshot 92

    Here's a guide that can also help you get the {fieldNames}: How-to-find-Field-IDs-Names

    Once you have those, you can now construct the link. 

    How can I pre fill form fields? Image 4 Screenshot 103

    After you have constructed the link, you can now create your Thank-You page.

    How can I pre fill form fields? Image 5 Screenshot 114

    You can also make the form where once it is submitted it will redirect the surveryor to the same form but this time it's pre-filled with the surveyor's details. But again, on the first entry, the surveyor is required to enter his/her information before he proceeds with the first survey.

    Here's another Sample form for that: https://form.jotform.com/53224614908960

    Here's how you can do it: 

    How can I pre fill form fields? Image 6 Screenshot 125

    I hope I was able to get to understand your request. Should you have any questions with any of the instructions or steps given above, please feel free to let us know and we will be glad to help you.