JQuery colorbox, close colorbox after form submitted

Using colorbox:

http://colorpowered.com/colorbox/ 

Im using this to open a window using the iframe function in colorbox. In the / iframe popup, I have a form. What I'm trying to achieve is when the form is submitted. I want the colorbox window to close and the parent window to be updated. Can anyone help me with this? Here is the code I'm using now, when I manually close the colorbox window, the parent page is updated, but how can I show the page inside the colorbox popup to close the colorbox?

  jQuery(document).ready(function(){ jQuery(".purchasepop").colorbox({width:"80%", height:"80%", iframe:true, onClosed:function(){ location.reload(true); }}); }); 
+7
source share
2 answers

Itโ€™s good for it to work, referencing the wrong โ€œvariableโ€ as I am using noconflict to load jquery. This worked:

 parent.jQuery.fn.colorbox.close(); 
+9
source

I used the following code to close the window with color in the click event of the cancel button.

 jQuery(document).ready(function () { jQuery("#<%= btnCancel.ClientID %>").click(function () { parent.jQuery.colorbox.close(); }); }); 
+1
source

All Articles