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

Question

Question

How to Change Width/Height of iFrame Using Embed Code?

asked on October 17, 2014

When using the embed code for a process, how do you add additional code to set the height and width of the iframe?

1 0

Answers

APPROVED ANSWER
replied on October 17, 2014 Show version history

You can modify the values directly in forms-embed.js. I'd recommend making a copy of the file (call it forms-embed2.js or something) and then modify the reference in the embed code. Or just backup the original file so you have something to revert back to if you ever need to.

In the .js file, you can look for

{var w='100%';if(myopt.formDiv!==null)

and change it to

{var w='50%';if(myopt.formDiv!==null)

to cut the width in half. As for the height, look for

var p=doc.body;myopt.formFrm.style.height=p.clientHeight+90+'px';

and change the "90" to a higher value.

You could play around with it to change the positioning and also use pixels instead of percentage. Here are some before and after screenshots that shows the effect of the changes

0 0
replied on November 6, 2014

This did not solve the issue. When I change the width it changes, but when I try and change the width it does nothing.

1 0
replied on November 6, 2014

The support case that was opened had been inactive for over a week. Please get in touch with your VAR if further support is needed.

0 0
SELECTED ANSWER
replied on April 22, 2016

I got the height to change by editing line 18:

Was: 

myopt.formFrm.onload=function(){if(myopt.autoheight){var doc=formapi.getFrmDocument();if(doc==null){myopt.formFrm.style.height='auto';}

Changed to: 

myopt.formFrm.onload=function(){if(myopt.autoheight){var doc=formapi.getFrmDocument();if(doc==null){myopt.formFrm.style.height='900px';}

 

0 0

Replies

replied on October 20, 2014 Show version history

I have changed the height to 100% and tried 90%, but it still looks like the first screenshot you took. To make sure it's not our CMS that is causing the issue, I created an empty HTML page and put the code in there and I get the same result. Any ideas?

The following code is being used:

<script type="text/javascript" src='https://server/Forms/js/forms-embed.js?v=9.2'></script>

 <script type="text/javascript">
var lf = new LaserficheForms.Form(document.getElementById('myform'), {
 bpid: '26', host: 'https://server/Forms', params: '',

onloadCallback: function () {
}
});
</script>

 

1 0
replied on October 20, 2014

Rename the .js file to .txt and attach it here for us to review.

0 0
replied on October 20, 2014

Here you go.

1 0
replied on October 20, 2014

Look for

var p=doc.body;myopt.formFrm.style.height=p.clientHeight+90+'px';

and change "90" to a higher number. You should be able to adjust the height that way as well.

0 0
replied on October 20, 2014

I changed it all the way to 600 and still nothing.

1 0
replied on October 20, 2014

Can you try with a new standalone form? Does it work if you change your embed code to

<script type="text/javascript" src='https://server/Forms/js/forms-embed.js?v=9.2'></script>
<script type="text/javascript">
var lf = new LaserficheForms.Form(null, {bpid: '26', host: 'https://server/Forms'});
</script>
0 0
replied on October 22, 2014

The new code you posted did not work. I did play around more with the forms-embed.js file and if I change the width values, they seem to take, but no matter what I change the height values to, nothing changes.

1 0
replied on October 22, 2014

Please open a support case with your reseller and provide a copy of the business process so that we can further investigate.

0 0
replied on October 22, 2014

Just opened a support case.

1 0
SELECTED ANSWER
replied on April 22, 2016

I got the height to change by editing line 18:

Was: 

myopt.formFrm.onload=function(){if(myopt.autoheight){var doc=formapi.getFrmDocument();if(doc==null){myopt.formFrm.style.height='auto';}

Changed to: 

myopt.formFrm.onload=function(){if(myopt.autoheight){var doc=formapi.getFrmDocument();if(doc==null){myopt.formFrm.style.height='900px';}

 

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

Sign in to reply to this post.