4.其他
???? 只允许输入数字和负号:<s:TextInput id="textinput_LOGOLeftW" restrict="0-9-+" />
?????只允许输入数字和点号:<mx:TextInput id="txt" restrict="0-9." />
?????只允许输入数字、英文、汉字:<mx:TextInput restrict="0-9a-z^{'[u4e00-u9fa5]'}"?/>
限制输入长度: maxChars=""
1. 限制某个字符的输入,用符号 ^ 跟上要限制的字符,可跟多个字符
????? <!-- 限制字符"~"的输入 --> ???? <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" /> 4.其他 ???? 只允许输入数字和负号:<s:TextInput id="textinput_LOGOLeftW" restrict="0-9-+" /> 限制输入长度: maxChars="" (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |