angularJS 中的逻辑form
angularJS中可以针对form表单进行校验,例如
<form name="myForm"> <input type="text" name="name" required/> <span ng-show="myForm.name.required">请输入名称</span> </form>
如果有多个区域需要校验,可以使用逻辑指令ng-form
<form submit="save()"> <div ng-form="form1"> ...controls... <button ng-click="proceed()" ng-disabled="form1.$invalid">Proceed</button> </div> <div ng-form="form2"> ...controls... <button type="submit" ng-disabled="form2.$invalid || form1.$invalid">Submit</button> </div> </form>
相关推荐
Qc 2020-07-19
swiftwwj 2020-07-05
wcqwcq 2020-07-04
TONIYH 2020-06-11
yhginny 2020-04-20
nicepainkiller 2020-05-12
苦咖啡flask 2020-05-09
xinjing0 2020-05-08
Lius 2020-05-05
ajaxtony 2020-05-04
bcbeer 2020-04-23
sicceer 2020-04-20
cmsmdn 2020-02-18
longshengguoji 2020-02-13
ajaxtony 2020-02-03
ELEMENTS爱乐小超 2020-01-17
waterv 2020-01-01