I have a login form that appears in a popup window. I would like to write some javascript (not sure if I should use regular js or Ajax) that will open a new full size window after the form is submitted, then close the current log in form popup window. How can I accomplish this? I know that my issue is, under normal circumstances you can't do anything else after a form submit because the page refreshes/redirects, etc. Thank you for any help or solutions to my problem.
I have looked at this question: Submit a form in a popup, and then close the popup but can't make sense of it, or if it applies to my problem.
Form:
<form name="catseczoneform30738" onSubmit="return checkWholeForm30738(this)" method="post" action="https://redlakewalleye.worldsecuresystems.com/ZoneProcess.aspx?ZoneID=12695&Referrer={module_siteUrl,true,true}&OID={module_oid}&OTYPE={module_otype}">
<div class="form">
<div class="item">
<label for="SZUsername">Username</label>
<br />
<input class="cat_textbox_small" type="text" name="Username" id="SZUsername" maxlength="255" />
</div>
<div class="item">
<label for="SZPassword">Password</label>
<br />
<input class="cat_textbox_small" type="password" name="Password" id="SZPassword" maxlength="255" autocomplete="off" />
</div>
<div class="item">
<input type="checkbox" name="RememberMe" id="RememberMe" />
<label for="RememberMe">Remember Me</label>
</div>
<div class="item">
<input class="cat_button" type="submit" value="Log in" name="submitButton" />
</div>
</div>
<script type="text/javascript" src="/CatalystScripts/ValidationFunctions.js"></script>
<script type="text/javascript">
//<![CDATA[
function checkWholeForm30738(theForm){
var why = "";
if (theForm.Username) why += isEmpty(theForm.Username.value, "Username");
if (theForm.Password) why += isEmpty(theForm.Password.value, "Password");
if (why != ""){
alert(why);
return false;
}
window.open('http://www.redlakewalleye.com/promotional/activation-form','_blank');
theForm.submit();
// window.close(); here?
return false;
}
//]]>
</script>
</form>