Using the StringValidator class : StringValidator « Data Model « Flex






Using the StringValidator class

Using the StringValidator class
     
<?xml version="1.0"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
  <mx:Form id="membershipForm">
    <mx:FormItem id="fullNameItem" label="Full Name">
      <mx:TextInput id="fullNameInput" />
    </mx:FormItem>
    <mx:FormItem id="userNameItem" label="Username">
      <mx:TextInput id="userNameInput" />
    </mx:FormItem>
  </mx:Form>
  <mx:StringValidator source="{userNameInput}" property="text"
    minLength="6" maxLength="12" />
</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.A StringValidator ensures text has been entered.A StringValidator ensures text has been entered.
6.Too long error and too short error messages for StringValidatorToo long error and too short error messages for StringValidator
7.StringValidator for Form text inputStringValidator for Form text input
8.Validating required fieldsValidating required fields