1
我希望用户只能在特定的TextInput中插入数字。任何人都知道如何做到这一点?如何限制用户只在TextInput中插入数字?
我希望用户只能在特定的TextInput中插入数字。任何人都知道如何做到这一点?如何限制用户只在TextInput中插入数字?
http://livedocs.adobe.com/flex/3/langref/mx/controls/TextInput.html#restrict
您可以使用范围,像这样:
在AS3:
myTextInput.restrict = '0-9';
在Flex:
<mx:TextInput id="myTextInput" restrict="0-9" />
我没有测试过日是,但它应该工作得很好,根据文档。