The StringValidator class validates a string Which is in a specified range or not.
The StringValidator class validates a string Which is in a specified range or not.The StringValidator class validates a string Which is in
a specified range or not.
You can set the minimuum and maximun range by using minLength and maxLength
property.
The tag of StringValidator is <mxStringValidator>.
|
<?xml version="1.0" encoding="utf-8"?> <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"xmlns:s=" library://ns.adobe.com/flex/spark"xmlns:mx=" library://ns.adobe.com/flex/mx"minWidth=" 955" minHeight="600"><![CDATA[ import mx.controls.Alert;]]> </fx:Script> <fx:Declarations><stringInfo> <username>{unametxt.text}</username> </stringInfo> </fx:Model> <mx:StringValidator source="{unametxt}" property="text"tooShortError=" The minimum length is 4 character. "tooLongError=" The maximum length is 15 character."minLength=" 4" maxLength="15"trigger=" {btn}" triggerEvent="click"valid="Alert.show( 'Validation Successful');"/> </fx:Declarations></s:Application> |
To view this page ensure that Adobe Flash Player version 10.0.0 or greater is installed.