I have two select boxes in my project. First one shows formats and the second one has two options, namely, "Yes" and "No". I have used angular chosen on both these boxes.
Initially, the "Yes" option from the second select box is disabled. I want to enable that option when the user selects "PDF" as format from the first select box.
These are my select boxes
//first
<select name="exporType" id="exporType" ng-model="interactor.parameters.exporType" ng-options="format for format in formatOptions" ng-change="checkDisable();" chosen>
<option value=""></option>
</select>
//second
<select name="maskAccountNumber" id="maskAccountNumber" ng-model="interactor.parameters.maskAccountNumber" style="width:145px;" chosen>
<option value=""></option>
<option value="N">No</option>
<option value="Y" ng-disabled="disableoption">Yes</option>
</select>
I am calling ng-change on first select box which would set the "Yes" option ( $scope.disableoption ) to true or false based on its selection
The function is as follows
$scope.checkDisable = function() {
console.log("Export type is "+$scope.interactor.parameters.exporType);
if($scope.interactor.parameters.exporType == "PDF")
$scope.disableoption = false;
else
$scope.disableoption = true;
};
The problem is that when I select "PDF" as option from first select box the "Yes" option doesn't update.
If I remove chosen from my select boxes it works fine but not with chosen