PDA

View Full Version : jQuery Form to Form Wizard and IFRAMES



TAGrafx
12-17-2010, 04:35 PM
jQuery Form to Form Wizard
http://www.dynamicdrive.com/dynamicindex16/formwizard.htm

I have a page I am creating that has a header and a footer and also has an iframe for the main body content. I have a jquery script that auto adjusts the height of the iframe and it works fine with all pages that are one page and height, but one of the pages I am loading into that iframe has the JQuery Form to Form Wizard on it, the height of the iframe only seems to go to the largest height of one of the tabs, is there anyway to readjust the height based on what tab I am on?

TAGrafx

ddadmin
12-18-2010, 06:29 PM
This is probably more of a question for the IFRAME resizing script than the Form Wizard. Is there a function within the later to reflow/calculate the height of the page when the page's height changes, as is the case when the user navigates to a different "tab" within the Form Wizard? If there is, you would call that function inside the onpagechangestart() event handler (http://www.dynamicdrive.com/dynamicindex16/formwizard_suppliment.htm) of Form Wizard, which lets you run code whenever the user changes "tab". For example:


var myform=new formtowizard({
formid: 'feedbackform',
persistsection: true,
revealfx: ['slide', 500],
onpagechangestart:function($, i, $fieldset){
recaliframeheight() //some function to call to recal iframe height
}
})

TAGrafx
12-20-2010, 02:53 PM
I am not a very strong programmer so can you give me a hint to what the "recaliframeheight" should be?

This is what I have in my script...

<script type="text/javascript">
$(function(){
$("#demoForm").formwizard({
validationEnabled: true,
focusFirstInput : true,
}
);
});

var myform=new formtowizard({
formid: 'demoForm',
persistsection: true,
revealfx: ['slide', 500],
onpagechangestart:function($, i, $fieldset){
recaliframeheight() //some function to call to recal iframe height
}
})

</script>

ddadmin
12-21-2010, 01:07 AM
Hi:
recaliframeheight() is simply an example (non existent) function. The exact function to call as mentioned depends on what's available to you inside the IFRAME resize script. You'll looking for something that when called would re-invoke the IFRAME script to recalculate the IFRAME's height based on the current state of the page.