What I'm trying to do is to enable submit button If all of the textboxes hold values in them. Disable the submit button otherwise. But the problem here is the number of textboxes may vary (dynamic) so I can not hardcode the models in ng-disabled
attribute.
This is what I've tried so far: http://jsfiddle.net/codef0rmer/6uKAT/
Is there any other approach I should follow?
This is the basic idea.
<form name="myForm">
Item1: <input ng-model="item1" required/><br/>
Item2: <input ng-model="item2" required/><br/>
Item3: <input ng-model="item3" required/><br/>
<button type="submit" ng-disabled="myForm.$invalid">Submit</button>
</form>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With