title: Javascript regex for foreign names
body: <p>I made a simple regex to validate names, the thing i hadn't thought it's that some of the users have two (or more names which is uncommon) and they have accents like áéióú.</p>
  
  <p>I'm also considering other characters like the Spanish ñ or ç.</p>
  
  <p>So far this is my validation code:</p>
  
  <pre><code>function validateForm(element) {
      var regex =  /^[a-zA-Z\-]+$/;
           var ctrl =  document.getElementById(element).value;
  
          if(ctrl == null || ctrl == '')
              return;
  
           if (!regex.test(ctrl)) {
  
           alert(element + ' not valid');
           document.getElementById(element).focus();
  }
  </code></pre>
  
  <p>I have no idea on how to do this, any hints?</p>