Set domain of value to check to int for NumberValidator : NumberValidator « Data Model « Flex






Set domain of value to check to int for NumberValidator

Set domain of value to check to int for NumberValidator
  

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
    <mx:NumberValidator source="{age}" 
                        property="text"
                        allowNegative="false"
                        negativeError="negative value" 
                        minValue="5"
                        maxValue="10" 
                        domain="int" 
                        trigger="{submitButton}"
                        triggerEvent="click" />
    <mx:Text text="Enter your age:" />
    <mx:TextInput id="age" />
    <mx:Button label="Submit" id="submitButton" />
</mx:Application>

   
    
  








Related examples in the same category

1.NumberValidator used to check a value and if the number is an integerNumberValidator used to check a value and if the number is an integer
2.Use NumberValidator to check negative valueUse NumberValidator to check negative value
3.Check integer value range with NumberValidatorCheck integer value range with NumberValidator
4.Set minimum and maximum values of a NumberValidatorSet minimum and maximum values of a NumberValidator
5.Using the NumberValidator classUsing the NumberValidator class
6.Config NumberValidator With data BindingConfig NumberValidator With data Binding
7.Using NumberValidator class to ensure that an integer is between 1 and 10Using NumberValidator class to ensure that an integer is between 1 and 10