Hi Amrutha

You can use Number Validator

Look following code

Regards
Kiran Reddy


<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">
        <fx:Script>             
        </fx:Script>
        <fx:Declarations>       
                <mx:NumberValidator id="numV" source="{sampleText}" 
property="text"
trigger="{myButton}" triggerEvent="click" domain="real" precision="5"
precisionError="Decimal Should Not be morethan 5"/>
        </fx:Declarations>
        <s:layout>      
                <s:VerticalLayout/>
        </s:layout>
        
        
        <mx:TextInput id="sampleText"/>
        <mx:Button id="myButton" label="Validate"/>
                
</s:Application>




On Thu, Sep 8, 2011 at 7:52 PM, naveen SR <[email protected]> wrote:
> Hello Amrutha,
> If my understanding from ur below snippet is correct your trying to use the
> text input only for decimal places, if yes use maxchars to 5 and restrict
> from 0 to 9.
> If your requirement is to have the same text input for both the integer and
> decimal ,  build simple custom component extending textinput to do this
> validation.
> Cheers,
> Naveen
>
> On Wed, Sep 7, 2011 at 10:14 AM, Amruta Kulkarni
> <[email protected]> wrote:
>>
>> Hi All,
>>
>> I am working on a flex application which has requirement to restrict user
>> to enter the numbers with 5 decimal places only.I tried the 'restrict'
>> property of TextInput control.Here is the code snippet that I tried:
>>
>>
>> <mx:TextInput id="txtValue" restrict="[0-9]*\.?[0-9]{0,5}" />
>>
>>  but this is not working.Can anyone help me out on this?Its very urgent.
>>
>>
>>
>> Thanks
>> -Amruta Kulkarni
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Flex India Community" group.
>> To post to this group, send email to [email protected].
>> To unsubscribe from this group, send email to
>> [email protected].
>> For more options, visit this group at
>> http://groups.google.com/group/flex_india?hl=en.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Flex India Community" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/flex_india?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups "Flex 
India Community" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/flex_india?hl=en.

Reply via email to