Código Javascript:
Ver original
<script type="text/javascript"> function validarForm3() { valor0 = document.getElementById("nombre_user").value; valor1 = document.getElementById("email_user").value; valor2 = document.getElementById("telefono").value; if(valor0 == null || valor0.length == 0 || /^\s+$/.test(valor0) ) {//valor del nombre alert('[ERROR] El campo debe tener un valor de...'); return false; } else if( !(/^\d{9}$/.test(valor2)) ) {//valor del telefono alert('[ERROR] El campo debe tener un valor numerico'); return false; } else if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3,4})+$/.test(valor1)){//valor del email alert("La dirección de email " + valor + " es correcta."); } else { alert("La dirección de email es incorrecta."); return false; } return true; } </script>
y este el formulario:
Código HTML:
Ver original
gracias