I'm working with Angularjs.
HTML:
<select name="questionId1" ng-model="abCtrl.form.questionSel.q1" ng-options="question.val for question in abCtrl.form.questions track by question.index"></select>
<select name="questionId2" ng-model="abCtrl.form.questionSel.q2" ng-options="question.val for question in abCtrl.form.questions track by question.index"></select>
I'd like the option the user selects will be disabled for the other selection and vice versa
Replacing
ng-options
withng-repeat
-ed options can be assimilated to a regression...You can use
... disable when ...
syntax inng-options
:First
ng-options
:Second
ng-options
:Here is a fiddle
Try to use different approach, like this
abCtrl.firstSelectValue would be default value of ur select box (otherwise it would have empty selection first time)
Two ways:
Look at the stack post: ng-options with disabled rows. A good solution is explained
Use a multi-slect component, by instance: http://dotansimha.github.io/angularjs-dropdown-multiselect/#/
Could you please try on angular
ngDisabled
there is lot of example's available in net could you please surf it . Also here I am attaching some sample code likefor
ngDisabled