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
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
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
Opening a new page in the same window
Sorry I can't help more.
-zylstra