Multiple Login users - javascript
<p>I want to use this javascript but being able to hard code 3 users, so that those 3 are able to Login. I'm a newbie with javascript so yea. The below is the code i use for a single user login. </p>

<pre><code>function validate(loginForm)
{
 var booValid = true;
 var strErrorMessage = "";
 var minLength=5;
 var maxLength=10;

 if(loginForm.pword.value.length &lt; minLength)
 {
  strErrorMessage = "password must at least 5 characters\n";
  booValid=false;
 }

 if(loginForm.pword.value.length &gt; maxLength)
 {
  strErrorMessage = "pasword must not more than 10 characters\n";
  booValid=false;
 }
 if(loginForm.loginid.value.indexOf("jss1@yahoo.com.au") == -1)
 {
    strErrorMessage = "Incorrect Login ID, Please try again\n";
    booValid = false;
 }
 else if(loginForm.loginid.value.indexOf("jss2@yahoo.com.au") == -1)
 {
    strErrorMessage = "Incorrect Login ID, Please try again\n";
    booValid = false;
 }
 else if(loginForm.loginid.value.indexOf("jss3@yahoo.com.au") == -1)
 {
    strErrorMessage = "Incorrect Login ID, Please try again\n";
    booValid = false;
 }

 if(!booValid)
 {
  alert(strErrorMessage);
 }

 return booValid;
}
</code></pre>

<p>I've tried to use "else if" but still doesn't work. It says the users name is wrong. </p>

<p>I've also try as:</p>

<pre><code>if(loginForm.pword.value.indexOf("jss1@yahoo.com.au") == -1) || loginForm.pword.value.indexOf("jss1@yahoo.com.au") == -1 || loginForm.pword.value.indexOf("jss1@yahoo.com.au") == -1)
{
strErrorMessage = "Incorrect Login ID, Please try again\n";
booValid=false;
}
</code></pre>

<p>Please help!</p>
