1

I have a form in angular and having some input boxes, checkbox and a submit button.Initially Submit button is Disabled. If I change any element from that form then the submit button become enable. I am making use of angularjs feature .$pristine and $invalid for that. It is working fine for input boxes but not working for checkbox change. Am I doing anything wrong? kindly guide me. See the fiddle :FIDDLE

2 Answers 2

2

You need to add an ng-model for checkbox

<input type="checkbox" ng-model="val" required />

Working Demo:http://jsfiddle.net/7qAqe/12/

"An input control that has the ngModel directive holds an instance of NgModelController. Such a control instance can be published as a property of the form instance using the name attribute on the input control. The name attribute specifies the name of the property on the form instance."
- Forms Documentation

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

Comments

0

You did not bind the checkbox input to any model. Refer to this demo

<input type="checkbox" required ng-model='rel.checked' />

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.