Jump to content
  • 0

Loading Forms While Embedded.


larsonchst

Question

So I have a page that has a form embedded into it. The form works like this: it opens with a T&S page they have to agree to, then after they agree it goes to a second datapage that is the form. The problem is that I have it embedded into my sharepoint site, and when they submit the first page the second form refreshes the entire page and instead of being embedded in the site it is now just the datapage by itself.

 

Is there any way to make this work so it stays embedded?

Link to comment
Share on other sites

4 answers to this question

Recommended Posts

  • 0

Use iframes

 

IFRAME:

<iframe name="ifrPerson" class="licIframe" id="ifrPerson"></iframe>

HTML...

<!doctype html>
<html>
<head>
</head>
<body onload="resizeFrame('ifrPerson')">
	<div id="ifr" class="ifrContent killHeader">

<!-- caspio snippet -->
		<script type="application/javascript" src="xxx"></script>
                <script type="application/javascript">try{f_cbload("xxxxxxxxxxxxx","http:");}catch(v_e){;}</script>
<!-- caspio snippet -->

	</div>
</body>
</html>

I use a script to set iframe source...

document.getElementById('ifrPerson').src = 'lic-person.html?LeadID='+varLeadID; 

and this one to resize the container... (must be called from the iframe)

//resize LIC iframe on iframe load
function resizeFrame(ifrName) {
    // Find the height of the iframe
	var ifrContentH = document.getElementById('ifr').scrollHeight;
    // is it too tall to be empty?
	if (ifrContentH > 32)	{
    // yup, then tell the parent to give it some room 
		window.frameElement.ownerDocument.getElementById(ifrName).style.height = ifrContentH+'px';
	} else	{
    // no, keep it 0px tall,,, or make it 0px after deleting a record.
		window.frameElement.ownerDocument.getElementById(ifrName).style.height = '0px';
	}
}

Hope it helps

Link to comment
Share on other sites

  • 0

I guess I should have mentioned I wanted a non iframe solution, sorry. While the iframes work, they get to be way too messy. One main issue is the frame size not being able to automatically adapt to the size of the form (which becomes an ugly issue when you have a lot of rules adding or removing fields).

 

It looks like your code has some resizing script. I'm guessing the src="XXX" should be the caspio form deploy link and the "xxxxxxxxxx" should be the initial height of the iframe? Is the http: after that supposed to be left like that or replaced with something?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...