Questions tagged [angularjs-ng-disabled]

This directive sets the disabled attribute on the element if the expression inside ngDisabled evaluates to truthy. The attribute is `disabled` with a `d`.

Spelling Note: The attribute is disabled; the directive is ng-disabled;
Both include the letter d at the end.

A special directive is necessary because we cannot use interpolation inside the disabled attribute.

Erroneous

<div ng-init="isDisabled = false">
    <button disabled="{{isDisabled}}">Disabled</button>
</div>

Use instead:

<div ng-init="isDisabled = false">
    <button ng-disabled="isDisabled">Disabled</button>
</div>

Resources

93 questions
15
votes
4 answers

How to disable a button in ANGULARJS

i have angularJS 1.5.0-rc.2 I found on the internet that i can use the directive data-ng-disabled="Expression" But it won't disable a button. What i tried : // don't work
Vincent Ducroquet
  • 864
  • 4
  • 14
  • 24
10
votes
2 answers

How to make selecting a radio button required before submitting

I have a series of questions which have radio answer choices. I can't figure out how to use AngularJS validation to require the user to select one before clicking "Next". Below is my code: EDIT: Please note that clicking "Next" gets the next…
Riz
  • 6,486
  • 19
  • 66
  • 106
7
votes
2 answers

ng-disabled not working with tag using font-awesome

I have created a plunk in which I want to validate a form that has a button created using font-awesome. The text field is required and I want to disabled the icon if no data is entered.But ng-disabled dosen't seem to support this functionality with…
forgottofly
  • 2,729
  • 11
  • 51
  • 93
6
votes
2 answers

How to enable or disable input fields dynamically in angular js material design

I am having an issue with ng-disable. as i am using angular material i think this is not working. I want my input box to be disabled or enabled dynamically based on condition. Note:- I have multiple input fields i want disable or enable all of the…
Hemanth Paluri
  • 363
  • 3
  • 5
  • 12
5
votes
3 answers

How to disable md-select

I need to disable a md-select but I couln't find it in the Angular documentation. This is my code:
Roby Sottini
  • 2,117
  • 6
  • 48
  • 88
5
votes
4 answers

Disable submit button after one click in angularJS

I would like to disable button after one click. Code:
5
votes
2 answers

why ng-disabled does not work?

This is my html tag: but input tag does not disable.
Hossein Akbarzadeh
  • 315
  • 1
  • 2
  • 11
4
votes
0 answers

Changing ng-disabled in a custom directive

I'm trying to wrap a button with a directive that will disable it according to the response from an external service. However, I need to preserve the original ng-disabled value (if any) of the button. I manage to get this done by changing the…
ethanfar
  • 3,733
  • 24
  • 43
3
votes
1 answer

ng-disabled not working for radio buttons and checkboxes

I am working on an AngularJS application. I am trying to create a page that allows the user to select one of three radio buttons. Two of the three also have checkboxes underneath them to allow the user to select additional options if they've…
Ant
  • 545
  • 1
  • 9
  • 26
3
votes
2 answers

How to use ng-if with ng-disabled

Below is my Code. var myfriend = angular.module('myfriend',[]); myfriend.controller('myfriendController', function($scope) { $scope.record = [ { "id" : "01", "firstname" : "Mohan ", "middlename" :…
2
votes
1 answer

AngularJS set disable/enable buttons without using ng-disabled and ng-click on dynamically generated html

I'm having a problem how to solve to implement buttons refresh (enable/disable) without using ng-disabled and ng-click I've send to my directive the following configuration (one or more buttons) buttonsConfig() { var button1 = { icon: '
2
votes
2 answers

Change button text dynamically in AngularJs

I am working with AngularJS, CSS and HTML. Here's what I'm trying to do: A button gets disabled based on the output of a certain function isPublished(). I need the hover text over the button like When the button is disabled the hover over text could…
Nikhil Hegde
  • 341
  • 1
  • 3
  • 15
2
votes
0 answers

ng-disabled / ng-readonly no working

I'm working on an AngularJS app and I'm stuck. I have a simple tabbled interface section with the same layout for every tab section. When I switch the tab, I check to see what conditions are met and, depending on the result, I want to disable some…
daydr3am3r
  • 920
  • 4
  • 12
  • 31
1
2 3 4 5 6 7