0

I have a secure zone log in form. These normally get processed then the user is taken to a specific page that is the landing page for the secure zone. I would like to change the log in form so that it logs them in the same way, but allows me to redirect them to a different page. How can I use javascript to accomplish this? The reason for doing this is that I have almost 3000 subscribers to this secure zone and don't want to have to duplicate them for a different secure zone. Any help is greatly appreciated.

html form:

<form name="catseczoneform74513" onSubmit="return checkWholeForm74513(this)" method="post" action="https://redlakewalleye.worldsecuresystems.com/ZoneProcess.aspx?ZoneID=12369&amp;Referrer={module_siteUrl,true,true}&amp;OID={module_oid}&amp;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 checkWholeForm74513(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();return false;}
            //]]>
        </script>
    </form>
Phorden
  • 994
  • 4
  • 19
  • 43
  • Do you want to redirect a user to different pages within your secure zone? Say someone is logged in, bookmarks a page, logs out, then comes back to the bookmarked page...you need to send them to the login page, then to the bookmarked page? – Tim Nov 07 '13 at 15:50

2 Answers2

2

To redirect a user to a different location with javascript, use the following:

window.location.href = "http://www.example.com";

As stated here, an alternate method is as follows:

window.location.replace("http://stackoverflow.com");

The first emulates the behavior of clicking on a link, the other acts as a HTTP redirect.

Community
  • 1
  • 1
Matthew Johnson
  • 4,875
  • 2
  • 38
  • 51
0

you can use document.location.href = "link";

Eduardo Pino
  • 66
  • 1
  • 5