Reado
Reado

Reputation: 1452

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.

Upvotes: 1

Views: 2480

Answers (3)

stereoIII6
stereoIII6

Reputation: 11

Hi there in case you haven't solved it ... For me the most efficient solution... cause it's minimal and doesn't even allow the false input to arrive!

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

// copy and paste 100% working as3 email restrict only allows underscore minus dot and at besides number and letters.

Upvotes: 0

Fréderic Cox
Fréderic Cox

Reputation: 321

What if you lose the spaces in the "restrict" property? You can check in the Flex code on the internal code of the restrict property setter function and then it might help you get to the solution (don't have time to look now)

Upvotes: 2

Related Questions