Friday, 9 December 2016

Angular JS1 - Disable submit button until form is valid

Disable submit button when form invalid with AngularJS

To void this, you just need to handle $pending state of the form:

<form name="myForm">
  <input name="myText" type="text" ng-model="mytext" required />
  <button ng-disabled="myForm.$invalid || myForm.$pending">Save</button>
</form>

No comments:

Post a Comment

System Design

1. Scalability Scalability refers to a system’s ability to handle increasing workloads, users, or data without affecting performance.. A sca...