Pre-populate Embedded Forms

  • Gotfryd
    Asked on February 28, 2022 at 2:09 PM
    Can embedded forms also be pre-populated with URL parameters?
  • Ross_J
    Replied on February 28, 2022 at 2:15 PM

    Embedded Forms can be pre-populated with URL parameters via iFrame Code and add the pre-populated URL in the src field.

    Sample iFrame Embed code (the script part is excluded) would be like this.

    <iframe

       id="JotFormIFrame-80644647259971"

       onDISABLEDload="window.parent.scrollTo(0,0)"

       allowtransparency="true"

       allowfullscreen="true"

      src="https://form.jotform.com/80644647259971"

       frameborder="0"

       style="width: 1px;

       min-width: 100%;

       height:539px;

       border:none;"

       scrolling="no"

      >

      </iframe>

    Please note that you can change the URL in the src field with pre-populated values.

    This app will help you generate the right pre-populated code. http://prepopulate.jotform.io/

    Related Guide: Prepopulating Fields to Your Jotform via URL Parameters

    If you need further assistance, please let us know.

  • Strulowitz
    Replied on March 2, 2022 at 9:41 AM

    Hmm, I dont get how that would work. If the form is on my site, and I want to pre-populate a field with the URL parameter, will the code pick up the URL parameters the same way it would on a jotform hosted form?

  • Jovanne JotForm Support
    Replied on March 2, 2022 at 10:16 AM

    Hi,

    When you embed the form, make sure that you change the source to the Page URL + URL parameters for example:

    <script type="text/javascript" src="https://example.com/registration?name[first]={name:first}&name[last]={name:last}&email={email}"></script>

    The same goes for the iFrame embed option, simply change the (src=) value.

    Please give it a try and let us know how it goes.

  • Strulowitz
    Replied on March 2, 2022 at 10:45 AM

    Oh, i think I see what you are saying - Will the script dynamically set the src value to the current page include the URL parameters?

  • Afzal JotForm Support
    Replied on March 2, 2022 at 11:44 AM

    Hi,


    You will need to set the value of the field manually and add the Generated URL to the iframe code.

    For example for my Form(https://form.jotform.com/213624976573971) I have the below embed code.

    <script type="text/javascript" src="https://form.jotform.com/jsform/213624976573971"></script>

    

    If I want to prepopulate the first name, last name and email address. You will need to change the embed code to:

    <script type="text/javascript" src="https://form.jotform.com/213624976573971?name[first]=Test&name[last]=Test&email=test%40test.com"></script>


    1646239420 621f9ebc133ff  Screenshot 10


    Should you have any other concerns, kindly let us know. 

  • Strulowitz
    Replied on March 2, 2022 at 1:32 PM

    So the embed code would be hard coded to just one name and email address, and not dynamically populated from the CRM?!

  • Afzal JotForm Support
    Replied on March 2, 2022 at 2:50 PM

    Hi,


    Yes, this option will not populate the fields dynamically. Can you please tell us what type of information you are looking to populate in those fields so we can suggest you something more suitable for your requirements?


    Looking forward to hearing from you.

  • Strulowitz
    Replied on March 2, 2022 at 4:03 PM

    I want to embed the form on my client's website, and pre populate a few fields to tether the form to the prospect.

    DealID, PersonID and sometimes some additional info to control the conditional fields of the form.

    This works well on the stand alone form hosted on JotForm, but it would look much more professional if the form was hosted on my clients site and not as a stand alone form.

    The CRM creates they links with the URL parameters and sends it to the prospect.

  • Jovanne JotForm Support
    Replied on March 2, 2022 at 5:21 PM

    Hi,

    Thank you for this information.

    As mentioned by my colleague, you need to manually set the URL parameters to pre-populate the form. Fields such as DealID, or PersonID should be prepopulated within the URL parameters to reflect the values on the form fields.

    Have you tried this workaround on your client's website?

    Please let us know.

    Thank you.