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.
AngularJS ng-disabled Directive The ng-disabled directive sets the disabled attribute of a form field (input, select, or textarea). The form field will be disabled if the expression inside the ng-disabled attribute returns true.
Disable the TextBox by adding the e-disabled to the input parent element and set disabled attribute to the input element.
You can't disable DIV . Disable work with button and input types only. You can try with css. Use ng-class.
Sometimes, we need to disable the button, and link on the click event. This task can be accomplished by implementing the ng-disabled directive that is used to enable or disable HTML elements. Parameter value: expression: It represents an expression that returns true if it sets the disabled attribute for the element.
You can put all form elements into fieldset
and use ng-disabled
to disable the whole fieldset.
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