Tuesday, May 21, 2024
 Popular · Latest · Hot · Upcoming
166
rated 0 times [  172] [ 6]  / answers: 1 / hits: 95898  / 11 Years ago, fri, october 25, 2013, 12:00:00

I have an input button that I want to set to disabled if a user selects a certain value from a select box:



Select menu:



<select id=jobstatus name=jobstatus  ng-model=associate.JobStatus class=form-control>
<option value=0>Current</option>
<option value=1>Former</option>
<option value=2>Never worked there</option>
</select>


Input Button:



    <input type=submit class=btn btn-info pull-right 
btn-lg btn-block ng-disabled={{associate.JobStatus === '2'}} />


Now when I am viewing the source, when I do select option 2, the input button element changes from value ng-disabled=false to ng-disabled=true but the disabled attribute is not applied to the button.



What am I doing wrong here?


More From » angularjs

 Answers
9

Use this



<input type=submit class=btn btn-info pull-right btn-lg btn-block ng-disabled=associate.JobStatus == 2 />

[#74721] Thursday, October 24, 2013, 11 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
reed

Total Points: 725
Total Questions: 85
Total Answers: 89

Location: Singapore
Member since Sat, Jul 25, 2020
4 Years ago
;