<!-- 限制字符"~"的输入 -->
<mx:TextInput id="xxx" restrict="^~" />
<!-- 限制字符"ab"的输入 -->
<mx:TextInput id="xxx" restrict="^ab" />
2. 设置只能输入某些字符,将允许输入的字符罗列出来即可,也可以用 - 组合表示字符范围
<!-- 只能输入abc -->
<mx:TextInput id="xxx" restrict="abc" />
<!-- 只能输入小写字母 -->
<mx:TextInput id="xxx" restrict="a-z" />
<!-- 只能输入小写字母、大写字母和数字 -->
<mx:TextInput id="xxx" restrict="a-zA-Z0-9" />
3. 组合使用
<!-- 只能输入数字和符号"." -->
<mx:TextInput id="xxx" restrict="0-9." />
<!-- 只能输入除ab之外的小写字母 -->
<mx:TextInput id="xxx" restrict="a-z^ab" />
3378



被折叠的 条评论
为什么被折叠?



