squall2501 Posted September 25, 2010 Report Share Posted September 25, 2010 (edited) Hola Tengo un ligero problema con este codigo,ya que lo que ingrese me envia el mensaje "nombre solo debe contener caracteres" aun solamente colocando los caracteres que escribi en el patron de la expresion Si alguien me puede dar una mano se lo agradeceria patron=/^[a-zA-Z][a-zA-Z]{3,9}$/; function validar(){ if(document.form1.nombre.value==0){ alert("Debe llenar el campo nombre"); document.form1.nombre.focus(); return; } if(document.form1.nombre!=patron) { alert("nombre solo debe contener caracteres"); document.form1.nombre.value=""; document.form1.nombre.focus(); return; } document.form1.submit(); } Edited September 25, 2010 by squall2501 Link to comment Share on other sites More sharing options...
Ra Posted September 27, 2010 Report Share Posted September 27, 2010 Se mueve a Webmaster. salu2 Link to comment Share on other sites More sharing options...
electronik_0 Posted September 27, 2010 Report Share Posted September 27, 2010 un poco de google ante de preguntar por aca http://www.webintenta.com/validacion-con-e...javascript.html Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now