;

PDA

Click to See Complete Forum and Search --> : Problem with a form


Remnorz
06-02-2006, 10:03 PM
Ok I have 2 basic problems that are probably some kind of error on the code but I can't seem to find them.

1) When I add information to the form, when the e-mail is created it will return the values -1 character. Example:

Name: Michael
Date: 10/9/12

It will show the values in the e-mail as:

Name: Michae
Date: 10/9/1

That's problem number 1... the second problem is:

The information will show if the .fla is open, if I close it and try and run the swf or html file to test it, it will open my e-mail handler but it wont show any information at all. I'm stuck and I need some help pls someone.

The Code:

on (release) {
trace(this.fecha.text);
trace(this.productor.text);
trace(this.codigo.text);
trace(this.nombreasegurado.text);
trace(this.direccionpostal.text);
trace(this.direccionfisica.text);
trace(this.segurosocial.text);
trace(this.telefono.text);
trace(this.propiedad.text);
trace(this.agregado.text);
trace(this.productos.text);
trace(this.injuria.text);
trace(this.ocurrencia.text);
trace(this.nombreadd.text);
trace(this.direccionad.text);
trace(this.direccionfisica2.text);
trace(this.direccionfisica3.text);
trace(this.comentarios.text);


urldata = "";

urldata += "Fecha: "+this.fecha.text+newline+" ";
urldata += "Productor: "+this.productor.text+newline+" ";
urldata += "Codigo: "+this.codigo.text+newline+" ";
urldata += "Nombre: "+this.nombreasegurado.text+newline+" ";
urldata += "Dirección Postal: "+this.direccionpostal.text+newline+" ";
urldata += "Dirección Física: "+this.direccionfisica.text+newline+" ";
urldata += "Seguro Social: "+this.segurosocial.text+newline+" ";
urldata += "Teléfono: "+this.telefono.text+newline+" ";
urldata += "Propiedades: "+this.propiedad.text+newline+" ";
urldata += "Agregado: "+this.agregado.text+newline+" ";
urldata += "Productos: "+this.productos.text+newline+" ";
urldata += "Injuria Personal: "+this.injuria.text+newline+" ";
urldata += "Cada Ocurrencia: "+this.ocurrencia.text+newline+" ";
urldata += "Nombre Asegurado Adicional: "+this.nombread.text+newline+" ";
urldata += "Dirección Adicional: "+this.direccionad.text+newline+" ";
urldata += "Dirección Física: "+this.direccionfisica2.text+newline+" ";
urldata += "Dirección Física: "+this.direccionfisica3.text+newline+" ";
urldata += "Comentarios: "+this.comentarios.text+newline+" ";

trace(urldata);

getURL("mailto:cincodolares@gmail.com?subject=Resp onsabilidad Personal&body="+urldata);
}

cancerinform
06-03-2006, 12:28 PM
I recommend you to give your button a name in the property inspector such as submitBut and put all your script in the actions frame on the main timeline. I assume that onRelease refers to a button and that the textfields are somewhere in the movie and not the button. So replace "this" by _root, since this would refer to the button. If you want to use this, then it needs to be this._parent.

submitBut.onRelease = function(){
trace(_root.fecha.text);
trace(_root.productor.text);
trace(_root.codigo.text);
.....

Remnorz
06-03-2006, 02:31 PM
Thanks man, I already fixed the problem but now I have a formatting problem it prints on the e-mail form but everything is together... is there any way I can add some kind of code to add an empty line between each item?...

cancerinform
06-03-2006, 02:53 PM
Instead of newline you can use this +"\n"+"\n"+

This should give you 2 lines.