quiera saber que codigo agregar para cuando introdusca un email correcto, me desaparesca el aviso que dice "Introduce un mail correcto".
codigo del php es :
Código PHP:
Ver original<?php
$nombre = $_POST["nombre"];
$telefono = $_POST["telefono"];
$mail = $_POST["mail"];
$mensaje = "Nombre: " . $_POST['nombre'] . "\n";
$mensaje .= "Telefono: " . $_POST['telefono'] . "\n";
$mensaje .= "Mail: " . $_POST['mail'] . "\n\n";
$mensaje .= "Mensaje: " . $_POST['mensaje'] . "\n\n";
$cabecera = "From: $nombre <$mail> \r\n";
$cabecera .= "Reply-To: $mail";
echo "estado=Su mensaje FUE Enviado";
}
else{
echo "estado=Su mensaje NO fue enviado";
}
?>
el as3
Código ASP:
Ver originalvar misVariables:URLVariables = new URLVariables();
var cargador:URLLoader = new URLLoader();
var pedido:URLRequest = new URLRequest();
pedido.url = "http://www.prueva/forma.php";
pedido.method = URLRequestMethod.POST;
pedido.data = misVariables;
cargador.dataFormat = URLLoaderDataFormat.VARIABLES;
btn_enviar.addEventListener(MouseEvent.CLICK, enviar);
cargador.addEventListener(Event.COMPLETE, cargaCompleta);
function enviar(event:MouseEvent)
{
if(mail_txt.text.indexOf("@") == -1 || mail_txt.text.indexOf(".") == -1)
{
aviso_txt.text = "Introduce un mail correcto";
}
else
{
enviarFormulario();
}
}
function enviarFormulario()
{
misVariables.nombre = nombre_txt.text;
misVariables.telefono = telefono_txt.text;
misVariables.mail = mail_txt.text;
misVariables.mensaje = mensaje_txt.text;
try
{
cargador.load(pedido);
}
catch (error:Error)
{
trace ("Error en el envío"+error);
}
}
function cargaCompleta(event:Event):void
{
nombre_txt.text = "";
telefono_txt.text = "";
mail_txt.text = "";
mensaje_txt.text = "";
gotoAndStop(10);
}
stop();
Código ASP:
Ver originaltelefono_txt.restrict = "0-9";
nombre_txt.tabIndex = 1;
telefono_txt.tabIndex = 2;
mail_txt.tabIndex = 3;
mensaje_txt.tabIndex = 4;
btn_enviar.tabIndex = 5;
Código ASP:
Ver originalaviso_txt.text = cargador.data.estado;