Flex restrict TextInput to accept only decimal numbers?

倖福魔咒の 提交于 2019-12-12 16:05:54

问题


  • Is there some easy way to restrict TextInput to accept decimal numbers in range -99.999999 to +99.999999 ?

it is Spark TextInput.


回答1:


You didn't specify a Spark TextInput or an MX TextInput. You can use the restrict property to prevent people from entering numeric values (and the period). It is available on both the Spark and MX components. Here are the Spark Docs.

After that, use a NumberValidator to validate the range, setting the min value and maxvalue.



来源:https://stackoverflow.com/questions/6300528/flex-restrict-textinput-to-accept-only-decimal-numbers

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!