0

I am working on MVC framework. In the Home-Page I have multiple forms, which is shown and hidden using data-ng-show data-ng-hide.

The problem is when I hide the form after filling some inputs fields, validation message fires when I reopen the form. How to resolve this problem?

3
  • Maybe you could show/hide the validation messages using similar logic that you already are using to show/hide things in the UI? Commented Aug 20, 2014 at 11:51
  • These message are shown only when form validation error occurs. And this done with ng-hide and show. The problem is when i close the form using ng-hide, after filling some fields, form $dirty validation fires. Since all the fields are mandatory. Commented Aug 20, 2014 at 11:57
  • A simple boolean variable that you set to true when the ng-submit/ng-click/whatever function is called would solve this. Commented Aug 20, 2014 at 19:08

1 Answer 1

1

use $scope.formName.$setPristine() on reopen function

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.