search

Home  >  Q&A  >  body text

angular.js - How to verify a form with checkbox in angularjs?

The html is as follows (just use it as an example, don’t mind the style):

<input type="email" name="email"> <textarea placeholder="Introduce yourself"></textarea> <input type="checkbox" ng-model="m1">Agree to trial terms <button>Submit application</button>

I just started learning angular. I would like to ask you, seniors, how to use angularjs to realize that the email and textarea are not empty, the checkbox is also checked, and the button can be clicked?

为情所困为情所困2775 days ago505

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