Posted By

elquemero on 01/06/11


Tagged

javascript html input validation


Versions (?)

Prohibir ciertos caracteres en un input


 / Published in: JavaScript
 

No permite ingresar la ñ o Ñ

  1. <html>
  2. <head>
  3. <script>
  4. //No permite ingresar la ñ o Ñ
  5. function coma(e) {
  6. tecla=(document.all) ? e.keyCode : e.which;
  7. //alert(tecla);
  8. if (tecla==241 || tecla==209) {
  9.  
  10. return false;
  11. }
  12. }
  13. </script>
  14. </head>
  15.  
  16. <body bgcolor="#FFFFFF" text="#000000">
  17. <input type="text" onKeyPress="return coma(event)">
  18. </body>
  19. </html>

Report this snippet  

You need to login to post a comment.