用数字和文本验证angular js中的输入 [英] Validating input in angular js with numbers and text
本文介绍了用数字和文本验证angular js中的输入的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我希望我的输入从04开始,然后才可以输入文本,但是开始应该从04开始,我已经搜索了所有位置,但是找不到合适的答案.
I want my input to be started from exactly 04 and then text can come after but start should be from 04 , i have searched every where but couldn't find any suitable answer.
我必须在angular js中使用ng模式.
I have to use ng pattern in angular js.
我们将不胜感激.
推荐答案
尝试
JS
$ scope.pattern ='(04).*';
HTML
ng-pattern ="pattern"
检查此工作提琴
这篇关于用数字和文本验证angular js中的输入的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文