Saurabh Nanda
Saurabh Nanda

Reputation: 6793

AngularJS -- How to disable a form when it's being submitted?

How does one disable the complete form (all input elements within it), while it's being submitted via AJAX? I've tried setting a $scope.form_state variable in the controller and binding it to the submit button's ng-disabled attribute, but it seems like a workaround. There should be an easier + straight-forward way of doing this.

Upvotes: 15

Views: 6892

Answers (1)

Tosh
Tosh

Reputation: 36030

You can put all form elements into fieldset and use ng-disabled to disable the whole fieldset.

Upvotes: 30

Related Questions