as1/function.checkMail
| 2236 | no demo link | [ code ] | 2004-11-16 08:36:39 |
This function check if an email is valid or not.
This is not a perfect check but as you know there's no way to be sure if an email address is really correct or not.
// EXAMPLE:
// mail_txt is instance name of input text
mail_txt.restrict = "0-9a-z_@.\\-";
// submit_btn is instance name of a button to check mail_txt.text
submit_btn.onPress = function() {
if( checkMail( mail_txt.text ) ) {
trace( "MAIL: OK" );
}
else {
trace( "MAIL: ERROR" );
}
}
This is not a perfect check but as you know there's no way to be sure if an email address is really correct or not.
// EXAMPLE:
// mail_txt is instance name of input text
mail_txt.restrict = "0-9a-z_@.\\-";
// submit_btn is instance name of a button to check mail_txt.text
submit_btn.onPress = function() {
if( checkMail( mail_txt.text ) ) {
trace( "MAIL: OK" );
}
else {
trace( "MAIL: ERROR" );
}
}