Flex 4 ~ validate email

var emailVal:EmailValidator = new EmailValidator();
var valResult:* = emailVal.validate(email.text);
if(valResult.type == "invalid"){
Alert.show('invalid email');
return;
}


<s:TextInput id="email"  />


reference
http://www.java2s.com/Code/Flex/Data-Model/UseEmailValidatortovalidateemailcelleditor.htm

沒有留言: