DougieMcN
Technical User
- Sep 16, 2007
- 13
Hi, I have a form set up in flash pointing to a PHP script on my webspace.
I checked the PHP script and when viewed in a browser it returns the parameters OK so I presume it is working.
My problem is the variables captured by user input are not being sent to me.
Please can anyone check my actionscript below for errors.
I have tried send() and sendAndLoad() so I feel I may have an issue with my LoadVars.
Thanks in advance.
stop();
var fullName:TextField;
var fullAddress:TextField;
var postcode:TextField;
var telNumber:TextField;
var emailAddress:TextField;
fullName.restrict = "A-Za-zÁáÉéêíÍãõç ";
fullName.maxChars = 40;
fullAddress.restrict = "0-9A-Za-zÁáÉéêíÍãõç!?.+\- ";
fullAddress.maxChars = 90;
postcode.restrict = "0-9A-Za-zÁáÉéêíÍãõç!?.+\- ";
postcode.maxChars = 10;
telNumber.restrict = "0-9A-Za-zÁáÉéêíÍãõç!?.+\- ";
telNumber.maxChars = 20;
emailAddress.restrict = "0-9A-Za-zÁáÉéêíÍãõç!?.+\- ";
emailAddress.maxChars = 50;
function sendEmail(fullName, fullAddress, postcode, telNumber, emailAddress)
{
var myData:LoadVars = new LoadVars();
myData.fullName = fullName.text;
myData.fullAddress = fullAddress.text;
myData.postcode = postcode.text;
myData.telNumber = telNumber.text;
myData.emailAddress = emailAddress.text;
}
this.submitButton.onRelease = function()
{
if (fullName.text == "" || fullAddress.text == "" || postcode.text == "" || telNumber.text == "")
{
gotoAndStop("error");
}
else
{
sendEmail();
gotoAndStop("correct");
}
myData.send(" "POST");
};
I checked the PHP script and when viewed in a browser it returns the parameters OK so I presume it is working.
My problem is the variables captured by user input are not being sent to me.
Please can anyone check my actionscript below for errors.
I have tried send() and sendAndLoad() so I feel I may have an issue with my LoadVars.
Thanks in advance.
stop();
var fullName:TextField;
var fullAddress:TextField;
var postcode:TextField;
var telNumber:TextField;
var emailAddress:TextField;
fullName.restrict = "A-Za-zÁáÉéêíÍãõç ";
fullName.maxChars = 40;
fullAddress.restrict = "0-9A-Za-zÁáÉéêíÍãõç!?.+\- ";
fullAddress.maxChars = 90;
postcode.restrict = "0-9A-Za-zÁáÉéêíÍãõç!?.+\- ";
postcode.maxChars = 10;
telNumber.restrict = "0-9A-Za-zÁáÉéêíÍãõç!?.+\- ";
telNumber.maxChars = 20;
emailAddress.restrict = "0-9A-Za-zÁáÉéêíÍãõç!?.+\- ";
emailAddress.maxChars = 50;
function sendEmail(fullName, fullAddress, postcode, telNumber, emailAddress)
{
var myData:LoadVars = new LoadVars();
myData.fullName = fullName.text;
myData.fullAddress = fullAddress.text;
myData.postcode = postcode.text;
myData.telNumber = telNumber.text;
myData.emailAddress = emailAddress.text;
}
this.submitButton.onRelease = function()
{
if (fullName.text == "" || fullAddress.text == "" || postcode.text == "" || telNumber.text == "")
{
gotoAndStop("error");
}
else
{
sendEmail();
gotoAndStop("correct");
}
myData.send(" "POST");
};