Ver Mensaje Individual
  #23 (permalink)  
Antiguo 31/08/2010, 21:20
agoraestudio
 
Fecha de Ingreso: marzo-2010
Mensajes: 61
Antigüedad: 14 años, 1 mes
Puntos: 1
Respuesta: mandar mail con datos obtenidos desde un formulario flash

Acabo de encontrar el problema. Bueno eran varios... el que tu me has dicho del tipo de dato, el for que no lo había definido bien pq he puesto <2
en vez de <=2 y que había declarado una función en vez de igualar directamente la variable a la función q había hecho para recoger los resultados... te pego el código como ha quedado... pero ya funciona perfecto ... MUchas gracias!!!




function buscaSeleccionados():Array {
var temp = new Array();
for(var i = 1; i <=2; i++) {
if(this["check" + i].selected) {
temp.push(this["check" + i].label);
}
}
return temp;
}







enviar = function () {
if (ragione.text.length !=0 && forma.length !=0 && comune.length !=0 && provincia.length !=0 && attivita.text.length !=0 && fatturato.length !=0 && servizio.length !=0 && importo.length !=0 && tipo.text.length !=0 && nome.length !=0 && telefono.length !=0 && mail.length !=0 && note.length !=0) {
if (mail.text.indexOf("@") != -1 && mail.text.indexOf(".") != -1) {

var tipo:Array = buscaSeleccionados();


form1 = new LoadVars();
form1.ragione = ragione.text;
form1.forma = forma.text;
form1.comune = comune.text;
form1.provincia = provincia.text;
form1.attivita = attivita.text;
form1.fatturato = fatturato.text;
form1.servizio = servizio.text;
form1.importo = importo.text;
form1.tipo = tipo;
form1.nome = nome.text;
form1.telefono = telefono.text;
form1.mail = mail.text;
form1.note = note.text;
form1.sendAndLoad("send.php", form1, "POST");
servidor_txt.text = "Stiamo inviando il tuo messaggio..";
ragione.text = "";
forma.text = "";
comune.text = "";
provincia.text = "";
attivita.text = "";
fatturato.text = "";
servizio.text = "";
importo.text = "";
tipo.text = "";
nome.text = "";
telefono.text = "";
mail.text = "";
note.text = "";
form1.onLoad = function() {
if (this.estatus == "ok") {
servidor_txt.text = "Il tuo messaggio è stato inviato.";
ragione.text = "";
forma.text = "";
comune.text = "";
provincia.text = "";
attivita.text = "";
fatturato.text = "";
servizio.text = "";
importo.text = "";
tipo.text = "";
nome.text = "";
telefono.text = "";
mail.text = "";
note.text = "";
} else {
servidor_txt.text = "Ci sono problemi con il server.";
}
};
} else {
email_txt.text = "Posta elettronica non valida";
}
} else {
ragione.text = "Dato richiesto";
forma.text = "Dato richiesto";
comune.text = "Dato richiesto";
provincia.text = "Dato richiesto";
attivita.text = "Dato richiesto";
fatturato.text = "Dato richiesto";
servizio.text = "Dato richiesto";
importo.text = "Dato richiesto";
tipo.text = "Dato richiesto";
nome.text = "Dato richiesto";
telefono.text = "Dato richiesto";
mail.text = "Dato richiesto";
note.text = "Dato richiesto";
}
};

enviar_btn.onRelease = enviar;