<form name="form"><label for="input">姓名</label><input name="input"></input><span id="sp1">name is required</span><span id="sp2">max length is 10</span></form>如何控制#sp1在未点击时隐藏,格式正确隐藏sp2只有超出长度才显示
<form name="form"> <label for="input">姓名</label> <input name="input" ng-maxlength="10" required></input> <span id="sp1" ng-show="!form.input.$pristine">name is required</span> <span id="sp2" ng-show="form.input.$invalid">max length is 10</span> </form>
Anguarljs表单验证的参考文档:http://www.cnblogs.com/rohelm...
Anguarljs表单验证的参考文档:
http://www.cnblogs.com/rohelm...