angular.js input data box turns red when input is correct
我想大声告诉你
我想大声告诉你 2017-05-15 17:12:08
0
4
610

Image description

我想大声告诉你
我想大声告诉你

reply all(4)
phpcn_u1582

You'd better submit the sample code online and run it. No problem can be seen from the code you provide now

滿天的星座

试试,ng-min ng-max

我想大声告诉你

You can set the corresponding style if the form verification succeeds or fails, http://blog.csdn.net/u0111270...

淡淡烟草味

In fact, you can put the input box in one <form></form> 里面,然后给 form 添加一个 name 属性:<form name="myForm"></form>。输入框给一个 ng-model,比如叫 size

By doing this, you can call myForm.size.$valid 来判断是否通过验证。类似的,你也可以从 myForm.size.$error this Object in HTML in real time to get more detailed error information

Use this to dynamically add class 就好,用 ng-class

to the input box
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template