Mega Code Archive

 
Categories / Flex / Components
 

Check the length of TextInput field value

<?xml version='1.0' encoding='UTF-8'?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">     <mx:Script>                  import mx.controls.Alert;         public function checkValue(inputValue:String):void         {             if(inputValue.length < 5)                 Alert.show("Are you sure there's not that much new?");         }         public function submitClicked():void         {             Alert.show("User says:" + whatsnew.text + " is new.");         }            </mx:Script>         <mx:Label text="What's new?" />         <mx:TextInput valueCommit="checkValue(event.currentTarget.text)" id="whatsnew" />         <mx:Button label="Submit" click="submitClicked()" />      </mx:Application>