title: How to use isNaN here properly?
body: <p>I have two fields. The first one is a name field and the other one is a number field.  I want to check if the number field is numeric, if not, then select() will be used and background turns to yellow instead of blue. Somehow I'm not getting what I want.</p>
  
  <pre><code>window.onload=function()
  {
  
  idUser = document.getElementById("user");
  
  document.getElementById("form").onsubmit=function()
  {
      if(idUser.value == "")
      {
          alert("Username Required");
          idUser.focus();
  
          return false;
      }
  
  birYear = document.getElementById("birthyear");
  
      if(isNaN(birYear))
      {
          birYear.select();
          alert("number");
          return false;
      }
  
  }
  }
  </code></pre>
  
  <p>I'm using <code>alert("number");</code> just to double check if it's doing it properly. I don't need an alert but somehow if I put number or text both ways it's just alert number which means I'm not doing what I want right.</p>
  
  <p>Thanks in advance for people giving me a hand.</p>