简体   繁体   中英

how do close modal form from another page

 $(document).ready(function()
 {
     $("#create-user").button().click(function()
     {
         $("#dialog-form").load('test.html').dialog({ modal:true, }); 
     }); 
 });

i have two page. from first page i want to call modal form with url test.html and i want to close the modal form from test.html page with Close

SimpleModal will automatically bind the close function (using the onclick event) to any element inside the dialog with the simplemodal-close class.

In addition, you can programmatically close the currently opened dialog by calling $.modal.close();

This means: in your closeWindow()-function, you could simply enter the line:

 $.modal.close();

Sample.

HTML:

<input type="button" onclick='pop = window.open("http://www.google.com");' value="Click Me" />
<a href="#" onclick="pop.close();">Close</a>

Javascript:

   <script>
       var pop;
   </script>

This works. Good luck!

关闭你可以使用的对话框,

$("#dialog-form").dialog('close'); 

有这个代码。

<form ... onsubmit="window.location.assign('#close')">

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM