title: Match Regular Expression in Javascript
body: <p>I am using Javascript to validate my form fields, and the below regular expression is not working. Am I using the wrong method to match?</p>
  
  <pre><code>var name=document.getElementById('first_name').value;
  
  if (!name.match(/^[A-Za-z]*$/))
  {
      document.getElementById('error').innerHTML = "Please match the regxp";
      document.getElementById('first_name').focus();
      return false;
  }
  </code></pre>
  
  <p>i am executing the above code on form submit.</p>