0
votes
<mx:NumberValidator source="{txt1}" property="text" integerError="Enter Integer value"
        minValue="10" maxValue="100"    domain="int" 
        trigger="{simul}" triggerEvent="click"
        valid="Alert.show('Validation Succeeded!');"/>

when the value of txt1 is less than 10 i get error message as " the amount entered is too small" how do i cahge this error message and color of it......here is the example i got

i main thing is how to customize it

http://livedocs.adobe.com/flex/3/langref/mx/validators/NumberValidator.html

2

2 Answers

1
votes

This can be solved by validating Number i.e for example Specify min value =0 and max value=100 in Numbervalidator

0
votes

Simply specify the exceedsmaxError and lowerThenMinError settings for your NumberValidator.

<mx:NumberValidator 
exceedsMaxError="Too big." 
lowerThanMinError="Too small" />

Fun fact: the default messages are not even identical. One is about number, the other about amount. It's because someone pointed that problem to me that I had to look for a solution.

For changing the color you could use this:

<mx:Style>
    .errorTip {
        borderColor: haloOrange;
        color: black;
        fontFamily: Base02Embedded;
        fontSize: 16;
        fontWeight: normal;
    }

    TextInput {
        errorColor: haloOrange;
    }
</mx:Style>