Wednesday, June 24, 2009

V is for Validators

The data that a user enters in a user interface control might or might not be appropriate for the application. In Adobe Flex applications, you use a validator to ensure the values in the fields of a form meet certain criteria. For example, you can use a validator to ensure that a user enters a valid phone number value, to ensure that a String value is longer than a set minimum length, or ensure that a ZIP code field contains the correct number of digits.

Included Validators in the mx.validators package:

  • StringValidator - validates input as a string
  • RegExpValidator - validates input against a regular expression
  • NumberValiator - validates input is a number
  • EmailValidator - validates input is in valid email address format
  • Date Validator - validates input is in valid date format
  • ZipCodeValidator - validates input is in zip code format
  • CurrencyValidator - validates input is a valid currency expression
  • PhoneNumberValidator - validates input is in valid phone number format
  • CreditCardValidator - validates input is in valid credit card format
Learn more about Flex Validators at Flex After Dark...

No comments:

Post a Comment