I want a button to be disabled unless text is present in a textarea. Here is what I have tried:
<textarea ng-model="shipment_ids"></textarea>
<button ng-click="do_something" ng-disabled="shipment_ids.length"></button>
However, the button is enabled no matter what.
I think you want the opposite of what your code states. Something like:
<textarea ng-model="shipment_ids"></textarea>
<button ng-click="do_something" ng-disabled="!shipment_ids">Click me</button>
Example on JSFiddle here.
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