1

我有一个弹出登录表单。我希望表单提交,然后关闭该弹出窗口。我怎样才能做到这一点?该窗口当前设置为在函数返回之前关闭。在这种情况下,window.close() 去哪儿了?感谢您的任何帮助。

形式:

<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" />
                &nbsp;<a href="/_System/SystemPages/PasswordRetrieveRequest">Lost password?</a></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;
        }
    theForm.submit();
    window.open('http://www.redlakewalleye.com/promotional/activation-form','_blank');
    window.close();
    return false;
    }
//]]>
       </script>            
</form>
4

1 回答 1

0

如果可能的话,window.close() 应该包含在服务器对提交事件的响应中。如果您将 window.close() 作为提交的一部分包含在表单上,​​它将导致您的表单在提交实际发生之前关闭。

于 2013-11-11T21:27:00.620 回答