1

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

1

1 Answer 1

5

You can use ng-disabled:

<button 
   class="btnS btn-success ctrl-btn" 
   ng-click="save()" 
   ng-disabled="!item"> Submit</button>
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.