2
I want to close both the i frame as well as the modal dialog box on a button click present inside the file which is called in the iframe.. the file included in the i frame is an external file having tabs.. So how to close the dialog box and iframe on a button click which is defined in the file..

I had searched the net for days but did'nt solved the problem....

//My Code for the iframe for and modal dialog box is as follows..


I want to close both the i frame as well as the modal dialog box on a button click present inside the file which is called in the iframe.. the file included in the i frame is an external file having tabs.. So how to close the dialog box and iframe on a button click which is defined in the file..

// here is the code for i frame

<div id="dialog_with_tabs" title="Vehicle Selection">// div of modal dialog
<div id="tabs_in_dialog">
<ul>
</ul>
<iframe id="myframe"  src="add.php" width="100%" height="400" frameborder="0" scrolling="auto" seamless="seamless">  /// here i have included a file which has tabs..
</iframe>  /*****************End of Iframe*********************/

</div>
</div>

/********************End of Div of Modal Dialog box***********************/ I want to close both the i frame as well as the modal dialog box on a button click present inside the file which is called in the iframe.. the file included in the i frame is an external file having tabs.. So how to close the dialog box and iframe on a button click which is defined in the file..

//code for modal dialog box popup is as follows..

<script type="text/javascript" >           //script for modal dialog
$("#dialog_with_tabs").dialog({
bgiframe: true,
autoOpen: false,
height: 400,
width: 700,
modal: true,
buttons: {

}
});

$("#dialog_with_tabs").bind('dialogopen', function() {
/* init tabs, when dialog is opened */

$("#tabs_in_dialog").tabs();
});
$("#dialog_with_tabs").bind('dialogclose', function() {
/* your function */
window.location.reload(true);
/* destroy tabs to avoid problems on re-open */
$("#tabs_in_dialog").tabs('destroy');
/* destroy dialog to avoid problems on re-open */
$("#dialog_with_tabs").tabs('destroy');
});
/* your function to open the dialog */
$('#tabtest').click(function() {
$('#dialog_with_tabs').dialog('open');
}) 
//$("#dialog_with_tabs").dialog('open'); //  opens the modal dialog
<!-- jquery part -->
</script>

/*********************End of script*********************/
I want to close both the i frame as well as the modal dialog box on a button click present inside the file which is called in the iframe.. the file included in the i frame is an external file having tabs.. So how to close the dialog box and iframe on a button click which is defined in the file..

// so how can close the dialog and iframe on a button click

any help will be appreciated......

Ardalan Shahgholi
  • 11,967
  • 21
  • 108
  • 144
Yogesh Pawar
  • 336
  • 2
  • 17

1 Answers1

0

Not sure how to implement this precisely, but I think this route will work!

http://davidwalsh.name/window-postmessage

Or, try this thread?

Pass jquery variables between iframe and parent

Community
  • 1
  • 1
Ben
  • 149
  • 10