title: How do I validate this form via JavaScript?
body: <p>I've done a simple, chess-based hobby project with HTML/CSS/PHP. It lists and displays the possible moves for a given piece based its type, location, and colour. The program doesn't consider any other pieces on the board, though.</p>
  
  <p><a href="http://freemusing.com/chess/" rel="nofollow">http://freemusing.com/chess/</a></p>
  
  <p>As you can see, the form works fine and has server-side validation. My problem is I'm not familiar enough with JavaScript to translate the server-side validation <strong>[edited for clarity] of the form's two text fields</strong> from scratch. Could somebody help replicate my PHP-validation code <strong>for the two inputs</strong> in JavaScript? I don't want to use any frameworks because I want to be ultimately be well-versed in JS.</p>
  
  <ul>
  <li>Here's the PHP code for the form: <a href="http://pastebin.com/embed_js.php?i=0LRJxkFg" rel="nofollow">http://pastebin.com/embed_js.php?i=0LRJxkFg</a></li>
  <li>Here's the PHP code for processing (see lines 76-120) <a href="http://pastebin.com/embed_js.php?i=pksn9xPd" rel="nofollow">http://pastebin.com/embed_js.php?i=pksn9xPd</a></li>
  </ul>
  
  <p>Any help is appreciated.</p>