问题
- 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