angular.js - How to avoid hidden form elements from validation in angular?
PHP中文网
PHP中文网 2017-05-15 16:59:01
0
4
554

Like the title, I have a form, and then I use angular form verification, but some form controls are sometimes hidden, so how can I skip the verification of those hidden form controls when I submit?

PHP中文网
PHP中文网

认证0级讲师

reply all(4)
黄舟

Then just don’t add validation to the hidden form controls


After reading other answers, I realized that I thought it was this <input type="hidden"/>
那你就用 ng-if

大家讲道理

Remove hidden controls directly from the page when submitting.

小葫芦

If you don’t need the hidden form, you can use ng-if to remove it

世界只因有你

Just replace ng-hide with ng-if

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template