There is a form, inside it there are two inputa (type = radio) depending on them other fields are mandatory (or vice versa). And when you click on select, without choosing anything, the form becomes not valid. How to correctly reset values ​​when selecting another inputa? I bring a piece of the form and a screenshot. It is also clear from the screenshot that the value of the model is changing .. But the value of validated fields is not. enter image description here

<form action="Url" method="post" name="form" class="form-validate-angular" data-invalid="{{form.$invalid}}"> <input type="radio" name="name" ng-value="'CLIENT_ACC'" ng-model="accountType"/> <input type="radio" name="name" ng-value="'ACCOUNT'" ng-model="accountType"/> <select class="styler" ng-required="accountType == 'CLIENT_ACC'" ng-model="account_row"> <option th:value="null">Не выбрано</option> <option th:value="${score}" th:each="score: ${accounts}"> <th:block th:text="${score}"></th:block> </option> </select> </form> 

  • And why are there two types of quotes in ng-value ? I suspect that single become part of the value - Artem Gorlachev
  • because in one case - this value of the model may be, and in the other case we explicitly communicate the value. - Maria

0