Popa Mihai

PopaMihai.com – Flex, Flash, AIR and ActionScript articles and tutorials

Archive for the ‘EmailValidator’ tag

How to Trigger a Flex Validator From a Keyboard Event and From a Text Event

2 comments

Flex Validators have two properties that you can use to trigger the validator using any kind of events:

The trigger property specifies the component that is generating the event that will triggers the validator. If you don’t specify this property Flex will use the the source property.

The triggerEvent property is used to specify the event that will trigger the validator.
Read the rest of this entry »

Written by Popa Mihai

July 30th, 2009 at 1:20 pm

Posted in Flex

Tagged with , , ,

Example of using the EmailValidator Class in Flex

3 comments

The EmailValidator in Flex verifies if a string is an formatted as an email address. The only parameters you can change to the EmailValidator are the error messages that the user receives when the validation found a problem.

Here is the syntax of the EmailValidator:

<mx:emailvalidator invalidCharError="Invalid characters in your email address." 
	invalidDomainError= "The domain in your email address is incorrectly formatted." 
	invalidIPDomainError="The IP domain in your email address is incorrectly formatted." 
	invalidPeriodsInDomainError="The domain in your email address has consecutive periods." 
	missingAtSignError="Missing an at character in your email address." 
	missingPeriodInDomainError="The domain in your email address is missing a period." 
	missingUsernameError="The username in your email address is missing." 
	tooManyAtSignsError="Too many at characters in your email address."></mx:emailvalidator>

Here is an example that checks if a string entered by the user is an email or not:

Read the rest of this entry »

Written by Popa Mihai

July 29th, 2009 at 9:15 pm

Posted in Flex

Tagged with , , ,