3 Replies Latest reply on Jun 17, 2009 9:14 AM by tweetle_beetle

    TextInput's restrict attribute: Allow two email addresses?


      Hey all!


      I've got a textinput field that should be able to hold and validate either:

      1) One email address; or

      2) Two email addresses, separated by a comma


      This is the code I'm using:

      <mx:TextInput id="user" color="0x000000" creationCompleteEffect="{sequenceEffect}" restrict="a-z A-z 0-9 ' \- @ . ," keyDown="enter_button(event)"/>


      It works perfectly for one email address, but this is what happens when I type in two:



      Is there any way to make TextInput's "restrict" attribute take one OR two @ symbols (and not just limit it to one)?


      If there isn't, how can I use a regular expression instead of restrict to accomplish this?  (I can write the pattern - I just don't know how to get TextInput to use it the way it uses restrict).


      Thanks, all