Comunidad de diseño web y desarrollo en internet online

Cómo evitar que mi formulario abra otra ventana?

Citar            
MensajeEscrito el 06 Jul 2009 05:06 pm
Señores resulta que tengo un formulario, la info pasa bien, el mail llega bien tanto el de confirmación como el de los campos del formulario hecho en flash, pero hay un problema y es que cuando le doy clicl en el botón enviar me crea una ventana que borra el contenido eso es como si le diera una orden y lo abriera en _self o algo así eh buscado y buscado y no he podido saber que es, a continuación adjunto el código de mi formulario:

Código ActionScript :

stop();
// --------------------------------------------------------------
// función que valida números
// --------------------------------------------------------------
String.prototype.isNumbers = function() {
   if (this.length<1) {
      return false;
   }
   for (i=0; i<this.length; i++) {
      code = this.charCodeAt(i);
      if (this.charAt(i) != " " && code<48 || code>57) {
         return false;
      }
   }
   return true;
};
// --------------------------------------------------------------
// valida mails
// --------------------------------------------------------------
String.prototype.isMail = function() {
   if (this.indexOf("@")>0 && this.indexOf("@") == this.lastIndexOf("@")) {
      if (this.lastIndexOf(".")>this.indexOf("@")+1 && this.lastIndexOf(".")<this.length-2) {
         return true;
      }
   }
};
// --------------------------------------------------------------
// función que limpia los campos
// --------------------------------------------------------------
function limpiar() {
   nom = "";
   telefono = "";
   mailFrom = "";
   body = "";
   mail_txt = "";
   mensaje_error = "";
}
// --
nombre.tabIndex = 1;
tel.tabIndex = 2;
mail.tabIndex = 3;
msg.tabIndex = 4;
// --
bEnviar.onRollOver = bLimpiar.onRollOver=function () {
   this.gotoAndPlay("sobre");
};
bEnviar.onRelease = function() {
   if (nom.length<1) {
      mensaje_error = "Por favor introduzca su nombre";
   } else if (telefono.length<7 or telefono.isNumbers() == false) {
      mensaje_error = "Por favor, introduzca un teléfono de contacto";
   } else if (!mail.text.isMail()) {
      mensaje_error = "Por favor, introduzca e-mail válido";
   } else {
      var ibsvar:LoadVars = new LoadVars();
      ibsvar.nom = nom;
      ibsvar.telefono =telefono;
      ibsvar.mailfrom = mailfrom;
      ibsvar.body = body;
      ibsvar.send( "form.php","","POST");  
      mensaje_error = "Mensaje enviado con exito";
      limpiar();

      
      }
};
// --
bLimpiar.onRelease = function() {
   limpiar();
};




Yo creo que el problema es del .fla pero no sé en donde, sin embargo les escribo la línea de código del php:

<?
$name=$_REQUEST['nom'];
$phone=$_REQUEST['telefono'];
$to = $_REQUEST['mailfrom'];
$body = $_REQUEST['body'];
$msg = "Nombre: $name \r";
$msg .= "Teléfono: $phone \r";
$msg .= "E-mail: $to \r\r\r ";
$msg .= "Comentarios : $body";
mail('[email protected]', 'Contacto', $msg, "From: $to");
$msg='<html> <head> <title> $titulo </title> </head>
<body>
<p>Gracias por elegirnos. <strong><font color="#FF9933" size="2" >aqui va el nombre</font></strong></p>

</body> </html>';

$headers = "from: [email protected] \r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";

mail($to, 'confirmación de la empresa', $msg,$headers );


?>

Mil y mil gracias por su ayuda.

Por juliovanegas

Claber

161 de clabLevel



Genero:Masculino  

Publicista

firefox
Citar            
MensajeEscrito el 06 Jul 2009 05:09 pm
En vez de:

ibsvar.send( "form.php","","POST");

Usa

ibsvar.sendAndLoad( "form.php",ibsvar,"POST");

Jorge

Por solisarg

BOFH

13669 de clabLevel

4 tutoriales
5 articulos

Genero:Masculino   Bastard Operators From Hell Premio_Secretos

Argentina

firefox
Citar            
MensajeEscrito el 06 Jul 2009 05:38 pm
Jorge muchisimas gracias, que datallazo, ya si dió.

Por juliovanegas

Claber

161 de clabLevel



Genero:Masculino  

Publicista

firefox

 

Cristalab BabyBlue v4 + V4 © 2011 Cristalab
Powered by ClabEngines v4, HTML5, love and ponies.