title: How to check input values against SQL database BEFORE submission?
body: <p>I want to be able to check if a user-name is not already taken before it is submitted. I've thought about using Javascript to get the value of the input field but how would I compare that to my SQL database? </p>
  
  <p>Basically, the question boils down to a couple of different questions:</p>
  
  <ol>
  <li><p>Can I somehow get the values of an input-field through PHP BEFORE submission?</p></li>
  <li><p>IF NOT, then can I somehow use a Javascript variable in PHP?</p></li>
  <li><p>IF NOT, is there something else I can do?</p></li>
  </ol>
  
  <p>If I can't do this, it's no big deal, I just always see sites that check to see if a field is valid run-time instead of having to reload the page or going to an error page, which is something that I definitely want to do as well.</p>
  
  <p>NOTE: I already know how to check to see if a user-name is taken, I just want to know if I can do it run-time, so there's no need to supply me with the SQL code haha.</p>
  
  <p>Thanks!</p>