You can store each opened window in an array and perform a check for open windows when the user tries to submit the form:
var windows = [];
$('a').click(function () {
var myWindow = window.open(this.href);
windows.push(myWindow);
});
$('form').submit(function () {
for (var i = 0; i < windows.length; i++) {
if (!windows[i].closed) {
alert('Close all windows before continuing');
return false;
}
}
});