You are viewing limited content. For full access, please sign in.

Question

Question

Pass Field Data (URL) into iFrame on Page Load

asked on March 24, 2014

I am trying to create a Form with a Laserfiche Weblink iframe. When the form loads, I have a WebLink url for a specific document stored as a data field. 

 

How can I get the URL to pass into the iframe? And to have it show on page load?


Thanks in Advance!

 

Doug

0 0

Replies

replied on March 25, 2014 Show version history

This is actually not too hard. I had to do this for a client once. You basically set up the basic structure in the form, but use javascript to change the inner HTML of a custom HTML field. This will allow you to change up the URL of the iFrame whenever your javascript function runs, or on page load if that is how you set it up

 

For loading javascript on page load:

$(document).ready(function (){
   // Code goes here
})

EDIT:

Please note, if you are using a URL parameter to get data stored into a field and use that to get the URL you need in the iFrame, then I believe you will need to have the field being filled by the URL to be above the iFrame that uses that information so that you have that field populated before you try to use that information

0 0
replied on January 29, 2016

If you load the WebLink iframe string into a field (#Field50 in my example) you can take that field value and put it in an HTML field (#q49 in my example) with the javascript below. Note that your Laserfiche Forms and WebLink sites have to be in the same domain.

 

WebLink iframe string to load into a single line field #Field50. You probably want to hide it.

<iframe id="myframe" src="https://yoursite/WebLink/0/doc/12345/Page1.aspx" width="100%" height="600px"></iframe>

Javascript to load the field value into the custom HTML field.

$(document).ready(function (){
   $( "#q49" ).html( $( "#Field50" ).val() );
})

 

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.