Form submit not working after update from ver 6 to 7.

Page: 1

Author Post
Member
Registered: Feb 2014
Posts: 11
Hello,

I upgraded from version 6 to 7 and now my form submission is not working. Any ideas? I'm thinking there was a feature change I haven't found that is affecting this. Essentially, I have an image in the caption/border that when clicked calls a function that submits the form in the iframe. For some reason when I click the image to submit the form it doesn't do anything in version 7... Her is the code I'm using. Thanks!

<script type="text/javascript">

function pdftextpop(CurrentRow) {

fb.end();

var divis = document.getElementsByName('divisionname_'+CurrentRow)[0].value;


fb.start('mediatypePdfPop.cfm?division='+escape(divis),'type:iframe width:250 height:68 enableDragResize:false doAnimations:true showClose:false outsideClickCloses:false contentBackgroundColor:#000 captionPos:bc caption:`<a href="#" onClick="closbox();" style="color:#000;"> <img src="webimages/savebutton.jpg"/> </a>` caption2:`&lt;b&gt;Pdf Text&lt;/b&gt;`');

}


function closbox() {

fb.getIframeWindow().document.pdftextfrm.submit();

}

</script>
Administrator
Registered: Aug 2008
Posts: 3381
The first thing I notice is the use of getIframeWindow(). This function is no longer on the Floatbox API as of version 7.

It can be quickly determined if this is the problem by viewing a developer console while testing the page and perhaps seeing an error message like "fb.getIframeWindow is not a function".

If you have only one floatbox open, and that floatbox contains iframe content, a reference to that iframe element is available as fb.fbContent. (See the API reference for details of working with multiple floatboxes open at the same time.)

Javascript in browsers provides easy and reliable access to the window and document objects in an iframe with the .contentWindow and .contentDocument properties.

Putting this together means that your submit line may be successful if rewritten as
fb.fbContent.contentDocument.pdftextfrm.submit();
Member
Registered: Feb 2014
Posts: 11
Worked great! Thank you

Page: 1