t_muffazal
Dec 6, 2002, 06:27 AM
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
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