Please help with my email validation in flash!
Trying to get the email validation working so it detects correct sytax... ANy ideas?
Thanks in advance:
email_txt.restrict = "a-z_.@0-9";
email_txt.maxChars = 40;
status_txt.text = '';
submit_btn.onRelease = function()
{
var email = email_txt.text;
// are all the fields filled?
if (email == '') {
status_txt.text = "Enter Your Email";
return;
}
// yes, all fields filled
sendEmail(email);
// sending data...
status_txt.text = "Processing...";
// prevent submitting again by disabling the button
this.enabled = true;
};
function sendEmail(email)
{
var myData = new LoadVars();
myData.email = email;
myData.onLoad = function(ok) {
if (ok) {
status_txt.text = this.message;
} else {
status_txt.text = "Try Again Later";
}
submit_btn.enabled = true;
};
myData.sendAndLoad('contactform.php', myData, 'POST');
}
|