title: validating using input.value.match in javascript
body: <p>I believe I have a fairly simple problem, but I am unfortunately unable to resolve it. I have searched for a while and tried several different variations of this code but cannot seem to get it to work.</p>
  
  <p>All I am trying to do is check and see if my input value has a alpha character in it opposed to a number.</p>
  
  <p>Here is my js function:</p>
  
  <pre><code>function checkLetters(input) {
      var numOnly = /^[0-9]+$/;
      var hasLetters = false;
      if (!input.value.match(numOnly)) {
          hasLetters = true;
      } 
      return hasLetters;
  }
  </code></pre>
  
  <p>and here is the code calling it:</p>
  
  <pre><code>&lt;input type="text" name="cc_number" size="13" maxlength="11" onblur="
      if(checkLength(cc_number.value) == true) {
      alert('Sorry, that is not a valid number - Credit Card numbers must be nine digits!');
      } else if (checkLetters(cc_number.value) == true) {
      alert('Credit Card number must be numbers only, please re-enter the CC number using numbers only.');
      }"&gt;
  </code></pre>
  
  <p>Any help or suggestions would be appreciated.</p>