0

我有一个横幅,上面有一个联系表。如果某些字段为空并且用户尝试提交它,则横幅将返回响应。但由于某种原因,响应文本中断或缺少字母。

应该是:名字

/*ActionScript 3.0 */

name_txt.addEventListener(MouseEvent.CLICK, fl_MouseClickHandler); 

function fl_MouseClickHandler(event:MouseEvent):void { 

trace("Mouse clicked"); 

stop(); 

}  

// custom function we create to populate the comboBox list
function addShopsToList ():void {
shopList.addItem( { label: "Esindus1" } );  
shopList.addItem( { label: "Esindus2" } );  
shopList.addItem( { label: "Esindus3" } );  
shopList.addItem( { label: "Esindus4" } );
}
// Run function above now
addShopsToList ();

// build variable name for the URL Variables loader
var variables:URLVariables = new URLVariables;

// Build the varSend variable
var varSend:URLRequest = new URLRequest("form_parse.php");
varSend.method = URLRequestMethod.POST;
varSend.data = variables;

// Build the varLoader variable
var varLoader:URLLoader = new URLLoader;
varLoader.dataFormat = URLLoaderDataFormat.VARIABLES;
varLoader.addEventListener(Event.COMPLETE, completeHandler);

// handler for the PHP script completion and return of status
function completeHandler(event:Event):void {
// remove processing clip
name_txt.text = "";
email_txt.text = "";
phone_txt.text = "";

// Load the response from php here
status_txt.text = event.target.data.return_msg;
 }

// Add event listener for submit button click
submit_btn.addEventListener(MouseEvent.CLICK, ValidateAndSend);

// function ValidateAndSend
function ValidateAndSend (event:MouseEvent):void {

// validate fields
if(!name_txt.length) {
    status_txt.text = "Please enter your name";
} else if (!email_txt.length) {
    status_txt.text = "Please enter your email";
} else if (!phone_txt.length) {
    status_txt.text = "Please enter your phone number";
} else {

    // All is good, send the data now to PHP

    // ready the variables in our form for sending
    variables.userName = name_txt.text;
    variables.userEmail = email_txt.text;       
    variables.userPhone = phone_txt.text;
    variables.userShop = shopList.value;

    // Send the data to PHP now
    varLoader.load(varSend);

} // close else condition for error handling

 } // close validate and send function

PHP:成功提交后:

$my_msg = "Täname $senderName, päringu eest."; // Thanking the user for successful completion
// Print the data back to flash who is patiently waiting for it in the onCompleteHandler
print "return_msg=$my_msg"; 

有任何想法吗?

4

1 回答 1

0

正如 cherniv 所说,您需要嵌入用于文本框的字体。要嵌入,请执行以下操作

Open Character Panel Window > Character 

在此处输入图像描述

在此处输入图像描述

希望有帮助

干杯!

于 2013-09-25T11:57:16.317 回答