# Feedback form not working - Need help

**URL:** https://forum.kirupa.com/t/feedback-form-not-working-need-help/247401
**Category:** flash
**Created:** [December 22, 2007, 1:16pm UTC](https://forum.kirupa.com/t/feedback-form-not-working-need-help/247401 "2007-12-22T13:16:45Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![anilnavis](https://avatars.discourse-cdn.com/v4/letter/a/ecb155/32.png) [@anilnavis](https://forum.kirupa.com/u/anilnavis)
#### Post date: [December 22, 2007, 1:16pm UTC](https://forum.kirupa.com/t/feedback-form-not-working-need-help/247401/1 "2007-12-22T13:16:45Z")

</div>

Hello,  
I made a flash feedback form with using flash components and and php mail form, but this form is not working properly. I didn’t get any email

This is the code in action script layer

//-------------------------------------------------------//

// import the required component classes.  
import mx.controls.\*;

// define the component instances on the Stage.

var name\_txt:TextInput;  
var email\_txt:TextInput;  
var phone\_txt:TextInput;  
var service\_txt:ComboBox;  
var dis\_txt:TextArea;  
var mail\_bu:Button;  
var name\_label:Label;  
var phone\_label:Label;  
var email\_label:Label;  
var des\_label:Label;

//set color of labels  
name\_label.setStyle(“color”, “0xFFFFFF”);  
name\_label.setStyle(“fontWeight”, “bold”);  
email\_label.setStyle(“color”, “0xFFFFFF”);  
email\_label.setStyle(“fontWeight”, “bold”);  
phone\_label.setStyle(“color”, “0xFFFFFF”);  
phone\_label.setStyle(“fontWeight”, “bold”);  
ser\_label.setStyle(“color”, “0xFFFFFF”);  
ser\_label.setStyle(“fontWeight”, “bold”);  
des\_label.setStyle(“color”, “0xFFFFFF”);  
des\_label.setStyle(“fontWeight”, “bold”);

// set the tabbing order for the components  
this.name\_txt.tabIndex = 1;  
this.email\_txt.tabIndex = 2;  
this.phone\_txt.tabIndex = 3;  
this.service\_txt.tabIndex = 4;  
this.dis\_txt.tabIndex = 5;  
this.mail\_bu.tabIndex = 6;

// set the default form focus to the name\_ti TextInput instance, and set the default button to the submit button.  
Selection.setFocus(name\_txt);  
focusManager.defaultPushButton = mail\_bu;

//when the submit button is clicked, send the form values to the server using a ++ LoadVars +++ object.  
var postBtnListener:Object = new Object();  
postBtnListener.click = function(evt:Object) {  
//if the name is blank, display an error message using the Alert component.  
if (name\_txt.text.length == 0) {  
Selection.setFocus(name\_txt);  
Alert.show(“Please enter your Name.”, “Hi”, Alert.OK);  
return false;  
}  
// make sure the user has filled in either the email\_address  
if (email\_txt.text.length == 0) {  
Selection.setFocus(email\_txt);  
Alert.show(“Please enter your Email Address”, “Hi”, Alert.OK);  
return false;  
}

```
if (phone_txt.text.length == 0){
    Selection.setFocus(phone_txt);
    Alert.show("Please enter your Phone.", "Hi", Alert.OK);
    return false;
    }

```

// make sure the comments\_ta TextArea instance isn’t blank.  
if (service\_txt.selectedIndex \< 1) {  
Selection.setFocus(service\_txt);  
Alert.show(“Please select the service.”, “Hi”, Alert.OK);  
return false;  
}  
if (dis\_txt.text.length == 0) {  
Selection.setFocus(dis\_txt);  
Alert.show(“Please enter your Message.”, “Hi”, Alert.OK);  
return false;  
}

// if all the required fields have been filled in, create a LoadVars object instance and populate it.  
var send\_lv:LoadVars = new LoadVars();  
send\_lv.name = name\_txt.text;  
send\_lv.email = email\_txt.text;  
send\_lv.phone = phone\_txt.text;  
send\_lv.phone = service\_txt.text  
send\_lv.dis = dis\_txt.text;  
send\_lv.onLoad = function(success:Boolean) {  
// if the comments were sent to the server and you received a response, clear the form fields and display an Alert message.  
if (success) {  
name\_txt.text = “”;  
email\_txt.text = “”;  
phone\_txt.text = “”;  
service\_txt.text="";  
dis\_txt.text = “”;  
Alert.show(“Thank you for your comments.”, “Success”, Alert.OK);  
} else {

// else you encountered an error while submitting to the server.  
Alert.show(“Unable to process your comments at this time.”, “Server Error”, Alert.OK);  
}  
};

// send the variables from Flash to the remote PHP template.  
send\_lv.sendAndLoad(“mail.php”, send\_lv, “POST”);  
};  
this.mail\_bu.addEventListener(“click”, postBtnListener);

// -------------------------------------------------------------------//

I don’t know whats the problem … I am attaching the PHP mail form for reference.

Any one knows about it please advice me whats the solution

Thanks  
Anil;(
