Ver Mensaje Individual
  #2 (permalink)  
Antiguo 06/09/2002, 11:45
woi
 
Fecha de Ingreso: febrero-2001
Ubicación: Barcelona - México D.F.
Mensajes: 205
Antigüedad: 23 años, 1 mes
Puntos: 0
Re: validar form c/flash

debes poner un codigo como este pero con tus campos...:

// PARA VALIDAR EL EMAIL
function validate (address) {
if (address.length>=7) {
if (address.indexOf("@")>0) {
if ((address.indexOf("@")+2)<address.las tIndexOf(".")) {
if (address.lastIndexOf(".")<(address.le ngth-2)) {
return (true);
}
}
}
}
return (false);
}
// EN EL BOTON ENVIAR

if ((((email == null)) || (email.length<1)) || (email == "ERROR! Address not valid")) {
email = "ERROR! Address not valid";
action = "";
}
if (!validate(email)) {
email = "ERROR! Address not valid";
action = "";
}
if (apellido_p == null) {
apellido_p = "ERROR! Name required";
action = "";
}
if (apellido_m == null) {
apellido_m = "ERROR! Name required";
action = "";
}
if ((validate(email)) && (email != "ERROR!") && (apellido_p != "") && (apellido_m != "")) {
action = "send";
gotoAndPlay ("wait");
}
if (nombre == null) {
nombre = "ERROR! Name required";
action = "";
}
if (direccion == null) {
direccion = "ERROR! Required";
action = "";
}
if (ciudad == null) {
ciudad = "ERROR! Required";
action = "";
}
if (tel == null) {
tel = "ERROR! Required";
action = "";
}
if (estados == null) {
estados = "ERROR! Required";
action = "";
}
if (pais == null) {
pais = "ERROR! Required";
action = "";
}
}