title: Regular expression on textarea
body: <p>I'm having a bit of trouble validating a form I have, I can check for only letters, numbers and a full stop ("period") in a single text input, but I can't for the life of me get it to work at all on a textarea field.</p>
  
  <p>in my validation I have this:</p>
  
  <pre><code>var usernamecheck = /^[A-Za-z0-9.]{5,1000}$/; 
  </code></pre>
  
  <p>the validation I've tried that doesn't work on the textarea ($ITSWUsers) is:</p>
  
  <pre><code>if(!document.all.ITSWUsers.value.match(usernamecheck))
                  {
                  alert ("Please write the usernames in the correct format (with a full stop between first and last name).");
                  return false;
                  }
  </code></pre>
  
  <p>however, the following on a 'input type="text"' works just fine on the same form</p>
  
  <pre><code>if(!document.all.SFUsersName1.value.match(usernamecheck))
                  {
                  alert("Usernames can only contain letters, numbers and full stops (no spaces).");  
                  return false;  
                  }  
  </code></pre>
  
  <p>I need it to validate usernames, 1 name per line
  e.g.</p>
  
  <pre><code>John.smith
  Peter.jones1
  </code></pre>
  
  <p>these are both OK but the following wouldn't be:</p>
  
  <pre><code>John Smith
  David.O'Leary
  3rd.username
  </code></pre>
  
  <p>any help/pointers with this would be greatly appreciated
  (I only know basic html/php/javascript)</p>