Restrict input letter for TextInput : TextInput Data « Components « Flex

Home
Flex
1.Chart
2.Components
3.Container
4.Data Model
5.Development
6.Effects
7.Event
8.Graphics
9.Grid
10.Style
Flex » Components » TextInput DataScreenshots 
Restrict input letter for TextInput
Restrict input letter for TextInput
          

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" verticalAlign="middle" horizontalAlign="center">
    <mx:Script>
        
            import mx.controls.Alert;
      
    </mx:Script>
    <mx:Model id="creditcard">
        <card>
            <cardType>{cardTypeCombo.selectedItem.data}</cardType>
            <cardNumber>{creditCardInput.text}</cardNumber>
        </card>
    </mx:Model>
    <mx:Panel title="Data Validation">
        <mx:ComboBox id="cardTypeCombo">
            <mx:dataProvider>
                <mx:Object label="American Express" data="American Express" />
                <mx:Object label="MasterCard" data="MasterCard" />
                <mx:Object label="Visa" data="Visa" />
            </mx:dataProvider>
        </mx:ComboBox>
        <mx:TextInput id="creditCardInput" restrict="1234567890" />
        <mx:Button label="Validate" click="ccv.validate()" />
    </mx:Panel>
    <mx:CreditCardValidator id="ccv"
        cardTypeSource="{creditcard}"
        cardTypeProperty="cardType"
        cardNumberSource="{creditcard}"
        cardNumberProperty="cardNumber"
        cardTypeListener="{cardTypeCombo}"
        cardNumberListener="{creditCardInput}"
        valid="Alert.show('Credit card is valid')" />    
</mx:Application>

   
    
    
    
    
    
    
    
    
    
  
Related examples in the same category
1.Using actionscript to access TextInput data in TextUsing actionscript to access TextInput data in Text
2.Use TextInput as the Credit card number data sourceUse TextInput as the Credit card number data source
3.Show an MXML-based data model with properties of TextInput controls bound into its fieldsShow an MXML-based data model with properties of TextInput controls bound into its fields
4.A TextInput's text property is bound to two data models, and data model properties are bound to the text properties of two Label controls.A TextInput's text property is bound to two data models, and data model properties are bound to the text properties of two Label controls.
5.shows an MXML-based data model with properties of TextInput controls bound into its fields:shows an MXML-based data model with properties of TextInput controls bound into its fields:
6.Max char and restrict letter for TextInputMax char and restrict letter for TextInput
7.Add item to a list from TextInputAdd item to a list from TextInput
w___w__w._j__a__v__a_2__s_.c__o_m | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.