title: Javascript SubString Validation/Comparison
body: <p>Ive been fiddling around with this piece of code for about an hour now and its boggling my mind. I think the solution would be fairly simple but i cant seem to figure it out. 
  Anyways here goes. I made a javascript function that checks the characters a user enters so that it can only accept 7 characters as a valid entry. This part works fine. What doesnt work is the next part it then checks the first three characters to see if they match up with the months of the year and if not it doesnt go through. So far it will never return true even if the characters being entered are jan2345 or feb3939 and so on and so on. Any help would be nice here is the code in question. </p>
  
  <pre><code> function validateBirthDate() {
   var s =document.pizza.birthday.value; 
   var check=/[A-Za-z]{3}[0-9]{4}/;
  
   if(s.length&lt;7 || s.length &gt; 7) {
    alert("The birth date should have 7 characters!");
    return false;
  }
   if(s.length==7) {
    if(check.test(s)==true) {
     if(s.substring(0,3)!=="jan" || s.substring(0,3)!=="feb" ||     s.substring(0,3)!=="mar"|| s.substring(0,3)!=="apr"  || s.substring(0,3)!=="may" ||     s.substring(0,3)!=="jun" || s.substring(0,3)!=="jul" || s.substring(0,3)!=="aug" ||     s.substring(0,3)!=="sep" || s.substring(0,3)!=="oct" || s.substring(0,3)!=="nov" ||     s.substring(0,3)!=="dec") 
    {
      alert("The first 3 characters must be a 3 letter abbreviation of one of the 12     months!");
      return false;
     }  
  </code></pre>