Hello!
I’m cool with posting to PHP - but decided to have an initial message in my textInput to instruct people to input their email address.
But now that the onFocus function is telling the textInput it equals “” when clicked, it is posting the variable as “” instead of what the user has input!!
How do I clear my textInput for the user but still post the user’s info?
The onFocus code is:
this.email_address.text = " your@email.com";
tiListener = new Object();
tiListener.onSetFocus = function () {
email_address.text = "";
};
Selection.addListener(tiListener);
And my posting code is:
var email_address:mx.controls.TextInput;
var tiListener:Object = new Object();
tiListener.handleEvent = function (evt_obj:Object){
if (evt_obj.type == "enter"){
if (email_address.length < 1) {
trace("You must enter at least 1 character");
} else {
trace("Thanks");
}
}
}
email_address.addEventListener("enter", tiListener);
btn_submit.onRelease = function() {
var mailingList:LoadVars = new LoadVars();
var email:LoadVars = new LoadVars();
email.email_address = email_address.text;
//Post data
email.sendAndLoad("mailingList.php", mailingList, "POST");
};