/ Published in: JavaScript
URL: http://www.telefonica.net/web2/blas-mar/validarformu.html
Expand |
Embed | Plain Text
function validarn(e) { // 1 tecla = (document.all) ? e.keyCode : e.which; // 2 if (tecla==8) return true; // 3 if (tecla==9) return true; // 3 if (tecla==11) return true; // 3 patron = /[A-Za-zñÑ'áéíóúÁÉÍÓÚàèìòùÀÈÌÒÙâêîôûÂÊÎÔÛÑñäëïöüÄËÏÖÜ\s\t]/; // 4 te = String.fromCharCode(tecla); // 5 return patron.test(te); // 6 } <input type="text" class="inputText" name="nombre" onkeypress="return validarn(event)" />
You need to login to post a comment.
