Too long error and too short error messages for StringValidator : StringValidator « Data Model « Flex






Too long error and too short error messages for StringValidator

Too long error and too short error messages for StringValidator
     

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
    <mx:StringValidator id="nameV"
        source="{nameTxt}"
        property="text"
        required="true"
        maxLength="10"
        minLength="2"
        tooLongError="This field contains 10 chars"
        tooShortError="You have to insert 2 chars at least" />
                
    <mx:Form id="myForm">
        <mx:FormItem label="Insert Name" required="true">
            <mx:TextInput id="nameTxt" />
        </mx:FormItem>
        
    </mx:Form>
    
</mx:Application>

   
    
    
    
    
  








Related examples in the same category

1.Using ActionScript to validate min length text inputUsing ActionScript to validate min length text input
2.Using StringValidator to check if the character count is within rangeUsing StringValidator to check if the character count is within range
3.Change event we can validate in real timeChange event we can validate in real time
4.Set StringValidator to validate required fieldSet StringValidator to validate required field
5.Using the StringValidator classUsing the StringValidator class
6.A StringValidator ensures text has been entered.A StringValidator ensures text has been entered.
7.StringValidator for Form text inputStringValidator for Form text input
8.Validating required fieldsValidating required fields