make form submit on new window using jquery
var form = document.createElement("form");
form.setAttribute("method", "post");
form.setAttribute("action", xxx);
function submitToPopup(f) {
var w = window.open('', 'form-target', 'width=600, height=400, any-other-option, ...');
f.target = 'form-target';
f.submit();
};
document.body.appendChild(form);
submitToPopup(form);