Close ColorBox iFrame after submit

colorbox, iframe, jquery

Solution

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();

Problem

I'm using jQuery `ColorBox` to display a shopping cart item. When a user enters the quantity in the iFrame (opened with colorbox) and clicks on the submit button, I want the iFrame to be close and main window (parent) to be refreshed automatically. I mean I want two things after submitting data on iFrame: - iFrame closes automatically. - Parent window getting refresh automatically. Please help me out.

Original source