Comunidad de diseño web y desarrollo en internet online

Formulario Flash con PHP

Citar            
MensajeEscrito el 27 Ene 2007 02:29 am
Muy buenas... bueno, ahora tengo un problema con un formulario que estoy elaborando, el formulario es extenso y lo hice en flash porque me arté que en html no me salgan alineadas los campos de texto, entonces, empezé con flash, yo tenia un formulario que hice hace mucho con un amigo pero es bastante basico, solo tenia 3 campos, entonces, empezé a añadirle mas campos, y ahora no me resulta el formulario, el formulario pueden apreciarlo en Nido Mundo Feliz, el error esta que cuando termino de llenar todos los campos y presiono enviar, me toma como si los campos de texto estuviesen vacios. Creo que yo que esta parte no tiene nada que ver con el PHP hospedado en el host... el codigo que puse en el formulario es este:

Código :

enviar = function () {
   if (email_txt.text.length && emailpapa_txt.text.length && emailmama_txt.text.length && nombre_txt.length && titulo_txt.length && mensaje_txt.length && edad_txt.length && naciodia_text.length && naciomes_txt.length && nacioano_txt.length && provincia_txt.length && domicilio_txt.length && fonocasa_txt.length && celular_txt.length && numerohermanos_txt.length && lugarhijos_txt.length && comoinforme_txt.length && emergencia_txt.length && fono_txt.length && nombrepapa_txt.length && ecivilpapa_txt.length && edadpapa_txt.length && gradoinstruccionpapa_txt.length && ocupacionpapa_txt.length && centrotrabajopapa_txt.length && cargopapa_txt.length && telefonopapa_txt.length && anexopapa_txt.length && nombremama_txt.length && ecivilmama_txt.length && edadmama_txt.length && gradoinstruccionmama_txt.length && ocupacionmama_txt.length && centrotrabajomama_txt.length && cargomama_txt.length && telefonomama_txt.length && anexomama_txt.length) {
      if (email_txt.text.indexOf("@") != -1 && email_txt.text.indexOf(".") != -1 && emailpapa_txt.text.indexOf("@") != -1 && emailpapa_txt.text.indexOf(".") != -1 && emailmama_txt.text.indexOf("@") != -1 && emailmama_txt.text.indexOf(".") != -1) {
         form_lv = new LoadVars();
         form_lv.nombre = nombre_txt.text;
         form_lv.mail = email_txt.text;
         form_lv.mensaje = mensaje_txt.text;
         form_lv.titulo = titulo_txt.text;
         form_lv.edad = edad_txt.text;
         form_lv.naciodia = naciodia_txt.text;
         form_lv.naciomes = naciomes_txt.text;
         form_lv.nacioano = nacioano_txt.text;
         form_lv.provincia = provincia_txt.text;
         form_lv.domicilio = domicilio_txt.text;
         form_lv.fonocasa = fonocasa_txt.text;
         form_lv.celular = celular_txt.text;
         form_lv.numerohermanos = numerohermanos_txt.text;
         form_lv.lugarhijos = lugarhijos_txt.text;
         form_lv.comoinformo = comoinformo_txt.text;
         form_lv.emergencia = emergencia_txt.text;
         form_lv.fono = fono_txt.text;
         form_lv.nombrepapa = nombrepapa_txt.text;
         form_lv.ecivilpapa = ecivilpapa_txt.text;
         form_lv.edadpapa = edadpapa_txt.text;
         form_lv.gradoinstruccionpapa = gradoinstruccionpapa_txt.text;
         form_lv.ocupacionpapa = ocupacionpapa_txt.text;
         form_lv.centrotrabajopapa = centrotrabajopapa_txt.text;
         form_lv.cargopapa = cargopapa_txt.text;
         form_lv.telefonopapa = telefonopapa_txt.text;
         form_lv.anexopapa = anexopapa_txt.text;
         form_lv.mailpapa = emailpapa_txt.text;
         form_lv.nombremama = nombremama_txt.text;
         form_lv.ecivilmama = ecivilmama_txt.text;
         form_lv.edadmama = edadmama_txt.text;
         form_lv.gradoinstruccionmama = gradoinstruccionmama_txt.text;
         form_lv.ocupacionmama = ocupacionmama_txt.text;
         form_lv.centrotrabajomama = centrotrabajomama_txt.text;
         form_lv.cargomama = cargomama_txt.text;
         form_lv.telefonomama = telefonomama_txt.text;
         form_lv.anexomama = anexomama_txt.text;
         form_lv.mailmama = emailmama_txt.text;
         form_lv.sendAndLoad("http://www.nidomundofeliz.com/formulario/send.php", form_lv, "POST");
         mensaje_txt.text = "Enviando Mensaje..";
         nombre_txt.text = "";
         email_txt.text = "";
         titulo_txt.text = "";
         edad_txt.text = "";
         naciodia_txt.text = "";
         naciomes_txt.text = "";
         nacioano_txt.text = "";
         provincia_txt.text = "";
         domicilio_txt.text = "";
         fonocasa_txt.text = "";
         celular_txt.text = "";
         numerohermanos_txt.text = "";
         lugarhijos_txt.text = "";
         comoinformo_txt.text = "";
         emergencia_txt.text = "";
         fono_txt.text = "";
         nombrepapa_txt.text = "";
         ecivilpapa_txt.text = "";
         edadpapa_txt.text = "";
         gradoinstruccionpapa_txt.text = "";
         ocupacionpapa_txt.text = "";
         centrotrabajopapa_txt.text = "";
         cargopapa_txt.text = "";
         telefonopapa_txt.text = "";
         anexopapa_txt.text = "";
         emailpapa_txt.text = "";
         nombremama_txt.text = "";
         ecivilmama_txt.text = "";
         edadmama_txt.text = "";
         gradoinstruccionmama_txt.text = "";
         ocupacionmama_txt.text = "";
         centrotrabajomama_txt.text = "";
         cargomama_txt.text = "";
         telefonomama_txt.text = "";
         anexomama_txt.text = "";
         emailmama_txt.text = "";
         form_lv.onLoad = function() {
            trace("LLEGO");
            if (this.estatus == "ok") {
               mensaje_txt.text = "Tu mensaje fue enviado...";
               nombre_txt.text = "";
               email_txt.text = "";
               titulo_txt.text = "";
               edad_txt.text = "";
               naciodia_txt.text = "";
               naciomes_txt.text = "";
               nacioano_txt.text = "";
               provincia_txt.text = "";
               domicilio_txt.text = "";
               fonocasa_txt.text = "";
               celular_txt.text = "";
               numerohermanos_txt.text = "";
               lugarhijos_txt.text = "";
               comoinformo_txt.text = "";
               emergencia_txt.text = "";
               fono_txt.text = "";
               nombrepapa_txt.text = "";
               ecivilpapa_txt.text = "";
               edadpapa_txt.text = "";
               gradoinstruccionpapa_txt.text = "";
               ocupacionpapa_txt.text = "";
               centrotrabajopapa_txt.text = "";
               cargopapa_txt.text = "";
               telefonopapa_txt.text = "";
               anexopapa_txt.text = "";
               emailpapa_txt.text = "";
               nombremama_txt.text = "";
               ecivilmama_txt.text = "";
               edadmama_txt.text = "";
               gradoinstruccionmama_txt.text = "";
               ocupacionmama_txt.text = "";
               centrotrabajomama_txt.text = "";
               cargomama_txt.text = "";
               telefonomama_txt.text = "";
               anexomama_txt.text = "";
               emailmama_txt.text = "";
            } else {
               mensaje_txt.text = "Problemas con el servidor\nIntentalo de Nuevo";
            }
         };
      } else {
         email_txt.text = "Correo Invalido";
         emailpapa_txt.text = "Correo Invalido";
         emailmama_txt.text = "Correo Invalido";
      }
   } else {
      email_txt.text = "Dato Necesario";
      nombre_txt.text = "Dato Necesario";
      titulo_txt.text = "Dato Necesario";
      mensaje_txt.text = "Dato Necesario";
      edad_txt.text = "Necesario";
      naciodia_txt.text = "Necesario";
      naciomes_txt.text = "Necesario";
      nacioano_txt.text = "Necesario";
      provincia_txt.text = "Necesario";
      domicilio_txt.text = "Necesario";
      fonocasa_txt.text = "Necesario";
      celular_txt.text = "Necesario";
      numerohermanos_txt.text = "Necesario";
      lugarhijos_txt.text = "Necesario";
      comoinformo_txt.text = "Necesario";
      emergencia_txt.text = "Necesario";
      fono_txt.text = "Necesario";
      nombrepapa_txt.text = "Necesario";
      ecivilpapa_txt.text = "Necesario";
      edadpapa_txt.text = "Necesario";
      gradoinstruccionpapa_txt.text = "Necesario";
      ocupacionpapa_txt.text = "Necesario";
      centrotrabajopapa_txt.text = "Necesario";
      cargopapa_txt.text = "Necesario";
      telefonopapa_txt.text = "Necesario";
      anexopapa_txt.text = "Necesario";
      emailpapa_txt.text = "Necesario";
      nombremama_txt.text = "Necesario";
      ecivilmama_txt.text = "Necesario";
      edadmama_txt.text = "Necesario";
      gradoinstruccionmama_txt.text = "Necesario";
      ocupacionmama_txt.text = "Necesario";
      centrotrabajomama_txt.text = "Necesario";
      cargomama_txt.text = "Necesario";
      telefonomama_txt.text = "Necesario";
      anexomama_txt.text = "Necesario";
      emailmama_txt.text = "Necesario";
   }
};
borrar = function () {
   nombre_txt.text = "";
   email_txt.text = "";
   mensaje_txt.text = "";
   titulo_txt.text = "";
   edad_txt.text = "";
   naciodia_txt.text = "";
   naciomes_txt.text = "";
   nacioano_txt.text = "";
   provincia_txt.text = "";
   domicilio_txt.text = "";
   fonocasa_txt.text = "";
   celular_txt.text = "";
   numerohermanos_txt.text = "";
   lugarhijos_txt.text = "";
   comoinformo_txt.text = "";
   emergencia_txt.text = "";
   fono_txt.text = "";
   nombrepapa_txt.text = "";
   ecivilpapa_txt.text = "";
   edadpapa_txt.text = "";
   gradoinstruccionpapa_txt.text = "";
   ocupacionpapa_txt.text = "";
   centrotrabajopapa_txt.text = "";
   cargopapa_txt.text = "";
   telefonopapa_txt.text = "";
   anexopapa_txt.text = "";
   emailpapa_txt.text = "";
   nombremama_txt.text = "";
   ecivilmama_txt.text = "";
   edadmama_txt.text = "";
   gradoinstruccionmama_txt.text = "";
   ocupacionmama_txt.text = "";
   centrotrabajomama_txt.text = "";
   cargomama_txt.text = "";
   telefonomama_txt.text = "";
   anexomama_txt.text = "";
   emailmama_txt.text = "";
};
enviar_btn.onRelease = enviar;
borrar_btn.onRelease = borrar;


aca esta el error, he hecho de todo, me fije punto por punto, no sé donde puedo estar fallando, pido porfa que me echen una manito con esto, desde ya gracias.

PD. les pongo los files por si acaso Formulario
^^

Por BlackMage

37 de clabLevel



 

firefox
Citar            
MensajeEscrito el 27 Ene 2007 08:13 am
Bueno, vamos a ver, para ser honesto no mucho entiendo que fue todo lo que hiciste pero creo que es probable que tu código tome como paso inicial la función de borrado que creaste y por lógica borra todos los campos y luego intenta enviarlo y como si están vacíos no los envía, te marca que son necesarios y así sucesivamente.

Hay formas más fáciles, te cuento que yo tengo un archivo que te puede facilitar más las cosas y no tenés que hacer tanta verificación y colocación de else e if y demás porque este formulario ya tiene una verificación automática de todos los campos y te muestra los mensajes cuando ha sido exitoso y cuando ha sido fallido el envío, este es el link http://www.lomasdesanantonio.com/web/email-flash-php.zip, ojalá te funcione bien, éxitos

Por Rudy3001

69 de clabLevel



 

Por los grandes paisajes de Guatemala

opera
Citar            
MensajeEscrito el 28 Ene 2007 03:52 am
muchas gracias... me he fijado, pero como que vuelvo al punto 0.
en verdad muchas gracias pero quisiera encontrarle alguna solución a eso que ya hice... alguien por ahi :crap:

Por BlackMage

37 de clabLevel



 

firefox
Citar            
MensajeEscrito el 28 Ene 2007 05:08 am
Ya probaste correr la aplicación sin la función de borrado?, será que realmente la necesitás?, si no estoy mal los campos se borran automáticamente cuando enviás un formulario por medio de Php, podrías probar y a lo mejor te funciona y en lugar de iniciar desde 0 podrías solamente copiar el archivo y borrarle la función "borrar" a la copia y ver si funciona así, mucho éxitos!

Por Rudy3001

69 de clabLevel



 

Por los grandes paisajes de Guatemala

opera

 

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