SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Threaded View

  1. #1
    SitePoint Zealot
    Join Date
    Dec 2000
    Norcross, GA
    0 Post(s)
    0 Thread(s)

    window.location.replace - absolutely not working

    I am close to pulling my hair out with this autorun menu I'm working on.

    I finally have the button problem worked out, and the problem with the forms in my other post.

    Now, though, I have a new problem.

    I've been to a few different sites to confirm syntax of window.location.replace, and have copied and pasted code into my script to first make sure thiers is working right -- it was. I made the changes to the path so teh correct page would load and for some unknown reason the dang redirect is not working at all now.

    Here's the code:

    function Form1_Validator001(theForm) {
    	// Test PW for validity.
        pw = new String(;
        if(pw == "") {
    		alert("A password is required to install this software.");
    		return (false);
        if(pw == "aeiou") {
    		// pw ok, do stuff
    		alert("about to make redirect line call...");
    		alert("and back to form validator loop...");
    		// alert("i just called the window.location line... and will now continue...");
    		return (true);
        } else {
    		alert("Incorrect password");
    		return (false);
    function doRedirect() {
    	var path = "Support/Extras/Program/program.html";
    	alert("about to issue redirect...");
    	window.location.replace( path );
    	alert("redirect issued...");
    As you can see I've added in alert boxes so I can see what's happening. They aren't providing any clues however. I'm getting zero errors, but the redirect does not work -- the thread returns to the validation loop and the "redirect issued" alert box appears.

    Please help, I'm losing my mind with this!
    Last edited by mstembri; Jan 23, 2002 at 22:01.
    - Mike


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts