search

Home  >  Q&A  >  body text

angular.js - angularjs怎么校验带checkbox的表单?

html如下(举例而用别介意样式):

<input type="email" name="email"> <textarea placeholder="介绍您的个人情况"></textarea> <input type="checkbox" ng-model="m1">同意试用条款 <button>提交申请</button>

刚初学angular,请教一下各位前辈,使用angularjs怎么样才能实现email、textarea都不为空,checkbox也被勾选的情况,button才能够被点击呢?

为情所困为情所困2744 days ago491

reply all(1)I'll reply

  • PHP中文网

    PHP中文网2017-05-15 16:53:31

    Suppose the ng-model settings of the three input textareas are m1 m2 m3, and then add ng-disabled='!m1||!m2||!m3' on the button

    reply
    0
  • Cancelreply