ng-pattern 验证问题
ng-pattern 验证问题
-
form表单一定要有name
-
<input type="text" placeholder="模块名称" name="TempletCustomNo" class="form-control rights_input" ng-pattern="/^[A-Za-z][\w]{0,19}$/" ng-model="addedTemplate.TempletCustomNo" required > <span class="red" ng-show="addTemplateForm.TempletCustomNo.$error.pattern">请输入有效的模块名称:1-20字只能包含英文/数字/下划线,且英文字母开头</span>
-
正则请看这里添加链接描述