0

We have a form which we are submitting on save button. There are some validation firing on save. We are submitting form using $scope.isSubmitted= true and $scope.watch on $scope.isSubmitted for error highlighting

After submitting and validating the form, if there is any new controls add to form on the basis of ng-if condition the new controls are also validated. So my question is how to prevent new controls which being added after submitting the form to validate and only validate after resubmit.

1
  • Please provide current status as fiddle Commented Oct 27, 2017 at 3:22

1 Answer 1

0

The problem is that when you add new "controls", you update your scope which is then re-evaluate. $scope.isSubmitted being true (and maybe yourForm.$submitted too) new values are verified on the fly.

Setting $scope.isSubmitted & yourForm.$submitted to false before adding "controls" should solve your issue.

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.