用angularjs怎么验证表单提交
1个回答
2017-03-02
展开全部
比如像下面一样:
<form name="system_email">
<div class="form-group has-feedback">
<label>邮箱名</label>
<input class="form-control input-feedback" name="emailName" type="email" ng-model="emailName" required />
<span class="help-block" ng-show="system_email.emailName.$dirty && system_email.emailName.$invalid">
<span ng-show="system_email.emailName.$error.required">邮箱名不能为空</span>
<span ng-show="system_email.emailName.$error.email">请输入有效的邮箱名</span>
</span>
</div>
</form>
<form name="system_email">
<div class="form-group has-feedback">
<label>邮箱名</label>
<input class="form-control input-feedback" name="emailName" type="email" ng-model="emailName" required />
<span class="help-block" ng-show="system_email.emailName.$dirty && system_email.emailName.$invalid">
<span ng-show="system_email.emailName.$error.required">邮箱名不能为空</span>
<span ng-show="system_email.emailName.$error.email">请输入有效的邮箱名</span>
</span>
</div>
</form>
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询