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

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

问题描述

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

它是 Spark TextInput.

it is Spark TextInput.

推荐答案

您没有指定 Spark TextInput 或 MX TextInput.您可以使用限制属性以防止人们输入数值(和句点).它可用于 Spark 和 MX 组件.以下是 Spark 文档.

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.

之后,使用 NumberValidator 验证范围,设置最小值和最大值.

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

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

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