Flex限制TextInput只接受十进制数字? [英] Flex restrict TextInput to accept only decimal numbers?

查看:193
本文介绍了Flex限制TextInput只接受十进制数字?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


  • 是否有一些简单的方法可以限制TextInput接受范围-99.999999到+99.999999的十进制数字?



它是Spark TextInput。

解决方案

您没有指定Spark TextInput或MX TextInput。您可以使用限制财产来防止人们输入数值(和期限)。它在Spark和MX组件上都可用。以下是 Spark Docs a>。

然后,使用 NumberValidator 来验证范围,设置最小值和最大值。

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

it is Spark TextInput.

解决方案

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.

这篇关于Flex限制TextInput只接受十进制数字?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆