Hi all,
I am using a simple script to validate a field in a form to ensure that the correct password is entered into the field before the person can get to the next page.
Currently it only take one password but I want to add another yet am struggling using an or condition in the javascript. Here is original code
--------------
function validate_form ( )
{
valid = true;
if ( document.getElementById('passbox_name').value == "" )
{
alert ( "Please enter your password" );
valid = false;
}
else if (document.getElementById('passbox_name').value != "aut2007" )
{
alert ( "Incorrect password, try again" );
valid = false;
}
if(valid)
{
document.location.href="key-availability-holidays.aspx?type=3&e=1844";
}
return valid;
}
-------------------------
So if someone enters aut2007 they are passed to another page but how do i say they could also enter aut2008 to go to the same page?
Thanks a lot
Lexx
I am using a simple script to validate a field in a form to ensure that the correct password is entered into the field before the person can get to the next page.
Currently it only take one password but I want to add another yet am struggling using an or condition in the javascript. Here is original code
--------------
function validate_form ( )
{
valid = true;
if ( document.getElementById('passbox_name').value == "" )
{
alert ( "Please enter your password" );
valid = false;
}
else if (document.getElementById('passbox_name').value != "aut2007" )
{
alert ( "Incorrect password, try again" );
valid = false;
}
if(valid)
{
document.location.href="key-availability-holidays.aspx?type=3&e=1844";
}
return valid;
}
-------------------------
So if someone enters aut2007 they are passed to another page but how do i say they could also enter aut2008 to go to the same page?
Thanks a lot
Lexx