How to pass url variables to iframe?

  • jsibley2
    Asked on September 30, 2015 at 2:59 PM

    I have read the help sections about passing parameters to jotform from the URL and that makes sense. However, I'm not sure how to put this into practice when embedding jotform in a page.

    In my particular case, I am using Drupal, and I can see how to embed a form using iframe (for example) and but I can't see how to combine that with the help on how to pass variables or parameters to the form.

    Could you please share an example of a way to pass this information that would work with Drupal?

    Thank you.

  • Mike
    Replied on September 30, 2015 at 5:09 PM

    The iFrame will not use the URL parameters of your web page, but you can prepopulate form directly by its URL on the iFrame.

    Add the URL parameters to the link specified in src.

    Example:

    src="https://secure.jotformpro.com/form/52726384212958?studentName[first]=John&studentName[last]=Doe&studentEmail=john%40example.com"

    How to pass url variables to iframe? Image 1 Screenshot 20

    If you need any further assistance, please let us know.

  • jsibley2
    Replied on September 30, 2015 at 5:19 PM

    Thank you. But how would one typically get that information into the src string of it isn't going to be hard coded into the src string? 

  • Chriistian Jotform Support
    Replied on October 1, 2015 at 2:21 AM

    Hi,

     

    If the value for the URL parameter is dynamic, I think you might need to programmatically add this to the src tag on your iFrame. You may use javascript to achieve this. 

     

    Do let us know if you need further assistance.
    Regards.