Ver Mensaje Individual
  #5 (permalink)  
Antiguo 18/03/2010, 11:03
Avatar de SirDuque
SirDuque
 
Fecha de Ingreso: febrero-2009
Ubicación: Paso del Rey, Buenos Aires, Argentina
Mensajes: 975
Antigüedad: 15 años, 2 meses
Puntos: 89
Respuesta: Validacion email, mas compleja

me salta siempre no pusiste punto de la linea 12....
te interprete mal raul (?)

Código Javascript:
Ver original
  1. <script language="JavaScript">
  2.   var correos="yahoo hotmail gmail live";
  3.   var dominio=document.formu.EMAIL.value.split("@");
  4.   var server=dominio[1].split(".");
  5.   var res=correos.match(server[0]);
  6.    function validar_email() {
  7.     if (document.formu.EMAIL.value.indexOf('@') == -1){
  8.      alert ("error no tiene arroba");
  9.      document.formu.EMAIL.focus();
  10.     } else {
  11.      if (document.formu.EMAIL.value.indexOf('.') == -1){
  12.      alert ("falta el punto");
  13.      document.formu.EMAIL.focus();
  14.    } else {
  15.      if (res==null){
  16.      alert ("no pusistenada");
  17.      document.formu.EMAIL.focus();
  18.     } else {
  19.    
  20.      document.formu.submit();
  21.     }}}
  22.    }
  23.   </SCRIPT>

aniMAYtions:

como complemento ese script por que no lo pude hacer andar.


les dejo el body

Código HTML:
Ver original
  1. <BODY><FORM NAME="formu" METHOD="POST" ACTION="Tu.Accion">
  2.    Ingresa tu Email: <INPUT NAME="EMAIL" TYPE="text"><BR>
  3.  
  4.    <INPUT type="button" name="ENVIAR" value="Agregar" onClick="JavaScrpit:validar_email();">
  5.   </FORM>
  6.  </BODY>