开发者

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

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜