How can I pre-fill some form elements?

  • Profile Image
    snaptailor
    Asked 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

  • Profile Image
    ardy0689
    Answered 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