title: How to enable disable a select drop down list using radio buttons with angularjs?
body: <p>I have been searching all over for the internet looking on how to enable or disable this drop down list using radio buttons specifically when the radio button value is equal to prof the drop down list should be disabled, but with no help. I did come up with an example but didn't work. Any help would be appreciated.</p>
  
  <p>registration.html</p>
  
  <pre><code>&lt;div class="form-group"&gt;
      &lt;label class="col-lg-2 col-md-3 control-label"&gt;Qualification&lt;/label&gt;
          &lt;div class="col-lg-10 col-md-9"&gt;
              &lt;div class="radio-custom radio-inline"&gt;
                  &lt;input type="radio" ng-model="QualificationDetails.qualification_type" value="edu" name="radio1" id="radio4"&gt;
                      &lt;label for="radio4"&gt;Educational&lt;/label&gt;
              &lt;/div&gt;
              &lt;div class="radio-custom radio-inline"&gt;
                  &lt;input type="radio" ng-model="QualificationDetails.qualification_type" value="prof" name="radio1" id="radio5"&gt;
                      &lt;label for="radio5"&gt;professional&lt;/label&gt;
              &lt;/div&gt;
          &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>//This is the drop down that I need to diable</p>
  
  <pre><code>&lt;div class="form-group"&gt;
      &lt;label class="col-sm-2 control-label" for="Qulitype"&gt;Qualification type&lt;/label&gt;
          &lt;div class="col-sm-10"&gt;
  
              &lt;select name="repeatSelect" id="repeatSelect" ng-disabled="QualificationDetails.qualification_type == 'prof'" ng-model="QualificationDetails.qualification" class="form-control"&gt;
                  &lt;option ng-repeat="quali in qualiLevel" value="{{quali.qualification_id}}"&gt;{{quali.quali_level}}&lt;/option&gt;
              &lt;/select&gt;
          &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>This is the code I implemented to work above scenario. But didn't work :(</p>
  
  <p>regController.js</p>
  
  <pre><code>$scope.$watch('QualificationDetails.qualicication_type', function (QualiType) {
              if (angular.isUndefined($scope.QualificationDetails)) {
                  return;
              }
              if (QualiType === 'prof') {
                  $scope.QualificationDetails.qualification_type = $scope.QualiType;
              }
              else {
                  if ($scope.QualificationDetails.qualification_type !== null) {
                      $scope.QualiType = $scope.QualificationDetails.qualification_type;
                      $scope.QualificationDetails.qualification_type = null;
                  }
              }
          });
  </code></pre>
  
  <p>the above scenario is that when it comes to qualifications if qualification type is equal to professional (prof) drop down list is disabled and when it is educational the drop down list should be enabled. Any idea on how to achieve this.</p>
  
  <p>This is the Quality level json.  I get it through the qualitylevel.service.</p>
  
  <pre><code>(function initController() {
  
      deptService.getdepts(function (res) {
          $scope.depts = JSON.parse(res.data);
  
      });
  
      qualiService.getquali(function (res) {
          console.log("inside ");
          $scope.qualiLevel = JSON.parse(res.data);
      });
  
      console.log("inside service");
  
  })();
  </code></pre>