Hi I have following dropdown
<select ng-model="item" ng-options="a.name for a in adda" ng-change="onChange()">
<option value="">
Add new account
</option>
</select>
In my code I have following button..
<button class="btnS btn-success ctrl-btn" ng-click="save()"> Submit</button>
What i want the button disabled and only be enabled if one of the options in the drop down is selected. Thanks
Hi I have following dropdown
<select ng-model="item" ng-options="a.name for a in adda" ng-change="onChange()">
<option value="">
Add new account
</option>
</select>
In my code I have following button..
<button class="btnS btn-success ctrl-btn" ng-click="save()"> Submit</button>
What i want the button disabled and only be enabled if one of the options in the drop down is selected. Thanks
Share Improve this question asked Jan 31, 2014 at 5:24 J. DavidsonJ. Davidson 3,31714 gold badges56 silver badges105 bronze badges 1- Check this link -- > ngDisabled – Amarnath Balasubramanian Commented Jan 31, 2014 at 6:35
1 Answer
Reset to default 5You can use ng-disabled
:
<button
class="btnS btn-success ctrl-btn"
ng-click="save()"
ng-disabled="!item"> Submit</button>