views:

4108

answers:

4

I'm using jQuery ColorBox to show a shopping cart item. When a user enters the quantity in the iframe and clicks on the submit button, I want the iframe to close and main window (parent) to be refreshed automatically.

I mean I want two things after submitting data on iframe:

  1. iframe automatically closes.
  2. parent window automatically refreshes.

Please help me out.

+1  A: 

I would take a look at http://colorpowered.com/colorbox/core/example1/index.html

Specifically, look at "Example with Alerts"

sberry2A
link is not working dear
diEcho
A: 

After the form is submitted in Frame 1, you can use the following JavaScript to reload the parent frame:

window.parent.location.reload(true);
barsh
where i have to write this?n that i frame or on parent html?and i think this is not working in jquery colorbox
diEcho
+3  A: 

use this on the parent window while opening iframe:

$(document).ready(function(){
    $(".chpic").colorbox({width:"80%", height:"80%", iframe:true, 
        onClosed:function(){ location.reload(true); } });
});

and this to close the iframe inside iframe page:

parent.$.fn.colorbox.close();
nik
A: 
<form target="_top">
Amien