0

I need to get a button disabled if any error is given in a form.

form(name="myForm", action="", method="post", novalidate)
.
.
.
    input(type="submit", value="Register" ng-disabled="//I need to get true here")

I have trying something like ng-disabled=myform.$error but the button is disabled even if any error is reported. What can I implement?

1 Answer 1

1

you can try ng-disabled="!myForm.$valid". This should work as $valid is true only if all fields in the form are valid

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.