Ask Me Help Desk

Ask Me Help Desk (https://www.askmehelpdesk.com/forum.php)
-   Other Software (https://www.askmehelpdesk.com/forumdisplay.php?f=394)
-   -   Opening a new page in the same window (https://www.askmehelpdesk.com/showthread.php?t=5377)

  • Dec 6, 2002, 06:27 AM
    t_muffazal
    Opening a new page in the same window
    Hi
    I have a simple problem. The script given below works fine but the problem is that it doesn't open the pages "success.htm" and "failure.htm" depending upon the conditions. The problem is in the script lines given:

    Document.location.href = "success.htm"
    Document.location.href = "failure.htm"

    What should I write so that "success.htm" and "failure.htm" pages should be opened according to the condition satisfied and in the same window. Thanks in advance.

    The Script :

    <script language = JavaScript>
    Function validate()
    {
    Var staticuid = "demouid"
    Var staticpwd = "demopwd"

    Var extractuid = document.form.username.value
    Var extractpwd = document.form.password.value

    If(staticuid == extractuid)
    {
    Document.location.href = "success.htm"
    }
    Else
    {
    Document.location.href = "failure.htm"
    }
    }
    </script>

    Muffazal
  • Dec 9, 2002, 05:34 AM
    zylstra
    Opening a new page in the same window
    I'm not much of a Javascript guru, but have you tried the following?

    {
    Window.location = "success.htm"
    }
    Else
    {
    Window.location = "failure.htm"
    }

    Also, be sure to check out http://developer.irt.org/script/redirect.htm .

    -zylstra
  • Dec 10, 2002, 07:35 AM
    t_muffazal
    Opening a new page in the same window
    Hi
    Thanks for the reply. I have tried what you have written but still it doesn't work. If possible please give me a solution as soon as possible.

    Muffazal
  • Dec 13, 2002, 01:04 PM
    zylstra
    Opening a new page in the same window
    Sorry I can't help more.

    -zylstra

  • All times are GMT -7. The time now is 11:10 PM.