开发者

how to restrict users to insert only numbers in a TextInput?

开发者 https://www.devze.com 2022-12-20 05:59 出处:网络
I want that the users will 开发者_运维百科be able to insert only numbers in a specific TextInput. Anybody knows how to do this ?http://livedocs.adobe.com/flex/3/langref/mx/controls/TextInput.html#rest

I want that the users will 开发者_运维百科be able to insert only numbers in a specific TextInput. Anybody knows how to do this ?


http://livedocs.adobe.com/flex/3/langref/mx/controls/TextInput.html#restrict

You can use a range like so:

In AS3:

myTextInput.restrict = '0-9';

In Flex:

<mx:TextInput id="myTextInput" restrict="0-9" />

I haven't tested this, but it should work just fine, according to the docs.

0

精彩评论

暂无评论...
验证码 换一张
取 消