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

    How can I pre-fill some form elements?

    Asked by snaptailor on December 12, 2013 at 12:27 PM

    I would like to pre-fill some form elements such as the user's email address if they are logged in. How can I do this?

     

    If that isn't possible, I've got a simpler request. How can I prefill the "city" element on my "Tailor Appointment" form. I would like it to default to "San Francisco"

     

    Thanks!

    Greg

    greg@snaptailor.com

    Page URL:
    http://snaptailor.com/pages/schedule-tailor-appointment

    elements fill email thanks
  • Profile Image
    JotForm Support

    Answered by ardy0689 on December 12, 2013 at 02:16 PM

    Thanks for contacting us. In order to pre-fill or prepopulate specific fields, all you need to do is to add a question mark ? from the form URL followed by the name of the field and its value

    For example, using your form "Schedule Tailor Appointment", pre-fill the email or city:

    email:

    http://www.jotform.us/form/32245775115150?email8=test@test.com

    City:

    http://www.jotform.us/form/32245775115150?preferredAppointment[city]=San%20Francisco

    Combining that on your current embed form on the webpage you will have to use this

    <script type="text/javascript" src="http://support.jotform.com/jsform/32245775115150?email8=test@test.com&preferredAppointment[city]=San%20Francisco"></script>

    In order to see the right field name to use, please view your form in the browser preferrably Firefox or Chrome(both browsers will use the same method).

    Then right click the field and click "Inspect Element". This will show Inspector tool on the specific field. The field name is pointed by the arrow below disregarding the q_10 or any prefix.

     

    If you need further assistance, please do not hesitate to ask or kindly open up a new thread if inquiring a new topic. Thank you