title: Username and Password validation to list
body: <p>I am very new to web development and am attempting to write code to validate username and password combinations. <a href="http://universe.tc.uvu.edu/cs2550/assignments/PasswordCheck/check.php" rel="nofollow">http://universe.tc.uvu.edu/cs2550/assignments/PasswordCheck/check.php</a> is the link to run the check, and <a href="http://universe.tc.uvu.edu/cs2550/assignments/PasswordCheck/list.php" rel="nofollow">http://universe.tc.uvu.edu/cs2550/assignments/PasswordCheck/list.php</a> is the list of acceptable entries. I am able to hard code in a username and password and that seems to be working fine, my question is simply "How can I hook up this input, to check inside the server for an acceptable login." Thank you for your help in advance!</p>
  
  <p>Here is my form:</p>
  
  <pre><code>&lt;form id = "formLogin" method = "post" name = "myform"&gt;
  &lt;label&gt;User Name: &lt;/label&gt;
  &lt;input type = "text" name = "username" id = "username" /&gt;
  &lt;label&gt;Password: &lt;/label&gt;
  &lt;input type = "password" name = "password" id = "password"&gt;
  &lt;input type = "button" value = "Login" id = "submit" onclick = "validate()"&gt;
  &lt;input type = "reset" value = "Reset"&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>Here is my javascript thus far:</p>
  
  <pre><code>function validate(){
  var username = document.getElementById("username").value;
  var password = document.getElementById("password").value;
  if(username == ""){
      alert("Please enter a User Name")
      formLogin.username.focus()
      return false
  }
  if(password == ""){
      alert("Please enter a Password")
      formLogin.password.focus()
      return false
  }
  if( username == "Test" &amp;&amp; password == "test#123"){
      alert("Login successfully");
      window.location = "gameboard.html";
      return false;
  }
  else{
   alert("Login failed - Please enter correct Username and Password")   
  }
  }
  </code></pre>