# Mail Form Problem

**URL:** <https://forum.kirupa.com/t/mail-form-problem/186481>\
**Category:** flash\
**Created:** [April 21, 2006, 3:52pm UTC](https://forum.kirupa.com/t/mail-form-problem/186481 "2006-04-21T15:52:37Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![gary\_hz](https://avatars.discourse-cdn.com/v4/letter/g/8dc957/32.png) [@gary\_hz](https://forum.kirupa.com/u/gary_hz)\
**Post date:** [April 21, 2006, 3:52pm UTC](https://forum.kirupa.com/t/mail-form-problem/186481/1 "2006-04-21T15:52:37Z")

</div>

Hi everybody  
this is my first post and i hope you can help me with this problem  
ok well my problem is the next

i find a example of a mail form using flash and Php i’m not having problems with the php but with the flash file the code i’m using is the one below  
(the variables names are in spanish)

well what I want to do is that people who use my form have/has to fill all the blanks but that they can leave the “telefono” blank on empty

Thanks, gracias

enviar = function () {  
if (email\_txt.text.length && nombre\_txt.length && telefono\_txt.length && mensaje\_txt.length && estado\_txt.length) {  
if (email\_txt.text.indexOf("@") != -1 && email\_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.telefono = telefono\_txt.text;  
form\_lv.estado = estado\_txt.text;  
form\_lv.sendAndLoad(“[http://www.pcservice.com.mx/medicinasmty/send.php](http://www.pcservice.com.mx/medicinasmty/send.php)”, form\_lv, “POST”)  
mensaje\_txt.text = “Enviando Mensaje…”;  
nombre\_txt.text = “”;  
email\_txt.text = “”;  
telefono\_txt.text = “”;  
estado\_txt.text = “”;  
form\_lv.onLoad = function() {  
trace(“LLEGO”);  
if (this.estatus == “ok”) {  
mensaje\_txt.text = “Tu mensaje fue enviado…”;  
nombre\_txt.text = “”;  
telefono\_txt.text = “”;  
email\_txt.text = “”;  
estado\_txt.text = “”;  
} else {  
mensaje\_txt.text = “Problemas con el servidor  
Intentalo de Nuevo”;  
}  
};  
} else {  
email\_txt.text = “Correo Invalido”;  
}  
} else {  
email\_txt.text = “Dato Necesario”;  
nombre\_txt.text = “Dato Necesario”;  
telefono\_txt.text =“Dato Necesario”;  
estado\_txt.text = “Dato Necesario”;  
mensaje\_txt.text = “Dato Necesario”;  
}  
};  
borrar = function () { nombre\_txt.text = “”;email\_txt.text = “”;mensaje\_txt.text = “”;estado\_txt.text = “”;telefono\_txt.text = “”;};  
enviar\_btn.onRelease = enviar;  
borrar\_btn.onRelease = borrar;  
nombre\_txt.tabIndex=1  
email\_txt.tabIndex=2  
telefono\_txt.tabIndex=3  
estado\_txt.tabIndex=4  
mensaje\_txt.tabIndex=5  
enviar\_btn.tabIndex=6
