title: How to validate a letter and whitespace only input via JavaScript regular expression
body: <p>I have an <code>input type="text"</code> for names in my HTML code. I need to make sure that it is a string with letters from 'a' to 'z' and 'A' to 'Z' only, along with space(s).</p>
  
  <p>This is my HTML code:</p>
  
  <pre><code>&lt;form action="" name="f" onsubmit="return f1()"&gt;
                  Name : &lt;input type="text" name="name"&gt;
  </code></pre>
  
  <p>I'm expecting my JavaScript to be something like this:</p>
  
  <pre class="lang-js prettyprint-override"><code>function f1() 
  {  
     var x=document.f.name.value;  
     ..... 
     ..... 
     return false;
  }
  </code></pre>
  
  <p>PS: I'm not really familiar with Regular Expressions, so please do put up an explanation with the code.</p>