chgbj 2023-11-20 10:19 采纳率: 6.3%
浏览 16
已结题

angular js 设置输入框是否可编辑

img


怎么做到针对一行,当检查结果选择“其他”时,实测值这一行可编辑,当检查结果选择其他值时,实测值这一栏不可编辑

  • 写回答

16条回答

  • threenewbee 2023-11-20 10:23
    关注
    获得0.75元问题酬金
    <html ng-app="app">
    <head>
        <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.5/angular.js">
    </script>
    </head>
    <body ng-controller="ctrl">
        <input type="number" ng-model="input1" ng-change="calc()"/> + <input type="number" ng-model="input2" ng-change="calc()"/> = <input type="number" ng-model="result" ng-change="recalc()" />
    </body>
    
    <script type="text/javascript">
    
      angular.module('app',[]).controller('ctrl',function($scope){
    
        
        $scope.recalc = function(){
    
          $scope.input1 = $scope.result - $scope.input2;
    
        };
    
        $scope.calc = function(){
          $scope.result = $scope.input1 + $scope.input2;
        }
    
      });
    
    </script>
    </html>
    
    
    评论

报告相同问题?

问题事件

  • 系统已结题 11月28日
  • 创建了问题 11月20日