Search code examples
actionscript-3apache-flexflex4.6

Restricting TextInput to email characters only


Using Flex SDK 4.6, I'm trying to restrict a TextInput field to email characters only as follows:

textInput.restrict = "a-z A-z 0-9 \- _ @ .";

However when I run my application, the TextInput field accepts any character. I'm really not sure why this is not working and would appreciate any help.


Solution

  • Try these links. This might be helpful

    http://www.oreillynet.com/pub/a/flex/excerpts/flex-4-cookbook/validation-formatting-regular-expressions.html

    http://blog.flexexamples.com/2008/08/29/validating-email-addresses-using-the-emailvalidator-class-in-flex/

    http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/mx/validators/EmailValidator.html