Flash - Validar un email en Action Script

 
Vista:

Validar un email en Action Script

Publicado por geobasis (2 intervenciones) el 04/05/2005 15:53:47
Hola, por favor si alguien me puede ayudar con el nombre de alguna funcion para validar el ingreso de un email en un textField de Flash con ActionScript.

De antemano muchas gracias por cualquier ayuda.
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder

RE:Validar un email en Action Script

Publicado por javi (1 intervención) el 06/05/2005 12:42:28
Es bastante completo. Además de validar el email comprueba que no te dejes vacios los campos.

function validate (address) {
if (address.length>=7) {
if (address.indexOf("@")>0) {
if ((address.indexOf("@")+2)<address.lastIndexOf(".")) {
if (address.lastIndexOf(".")<(address.length-2)) {
return (true);
}
}
}
}
return (false);
}
function formcheck () {
if ((((email == null)) || (email.length<1)) || (email == "ERROR! Direccion no válida")) {
email = "ERROR! La direccion no es válida";
action = "";
}
if (!validate(email)) {
email = "Direccion no valida";
action = "";
}
if ((((fname == null)) || (fname.length<1)) || (fname == "ERROR! Address not valid")) {
fname = "Nombre obligatorio";
action = "";
}
if ((((lname == null)) || (lname.length<1)) || (lname == "ERROR! Address not valid")) {
lname = "Nombre obligatorio";
action = "";
}
if ((validate(email)) && (email != "ERROR!") && (fname != "") && (lname != "")) {
action = "send";
loadVariablesNum (mailform, 0, "POST");
gotoAndPlay ("wait");
}
}
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar