Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/421.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 根据选择选项值Angularjs禁用输入字段_Javascript_Html_Angularjs_Select - Fatal编程技术网

Javascript 根据选择选项值Angularjs禁用输入字段

Javascript 根据选择选项值Angularjs禁用输入字段,javascript,html,angularjs,select,Javascript,Html,Angularjs,Select,在一个项目中,我有一个带有硬编码值和一些输入字段的下拉菜单。 如果选择了特定值,我需要禁用一些输入。我试过了 这是我的代码(我只包含了相关代码) 这不管用。我不知道这有什么问题 谁能帮我一下吗 在ng change中创建一个函数,并根据条件从该函数中禁用或不禁用输入。这里是示例演示 同时更改$scope.disableInputs===true至$scope.disableInputs=true如@maximedubois所述 角度模块(“应用程序”,[]) .controller(“ctrl

在一个项目中,我有一个带有硬编码值和一些输入字段的下拉菜单。 如果选择了特定值,我需要禁用一些输入。我试过了

这是我的代码(我只包含了相关代码)

这不管用。我不知道这有什么问题


谁能帮我一下吗

在ng change中创建一个函数,并根据条件从该函数中禁用或不禁用输入。这里是示例演示

同时更改
$scope.disableInputs===true
$scope.disableInputs=true如@maximedubois所述

角度模块(“应用程序”,[]) .controller(“ctrl”,函数($scope){ 如果($scope.paperSelection==377.95){ $scope.disableInputs=true; } 其他的 $scope.disableInputs=false; $scope.selectChange=function(){ 开关($scope.paperSelection){ 案例“1700”: $scope.disableInputs=true; 打破 案件'1191': $scope.disableInputs=false; 打破 违约: 控制台日志(“无值”); } } })

A3纸张
A4纸
A5纸
条形码标签3排
所需的列数:

输入贴纸的数量:

输入标签的高度(以像素为单位):


在ng change中创建一个函数,并根据该函数的条件禁用或不禁用输入。这里是示例演示

同时更改
$scope.disableInputs===true
$scope.disableInputs=true如@maximedubois所述

角度模块(“应用程序”,[]) .controller(“ctrl”,函数($scope){ 如果($scope.paperSelection==377.95){ $scope.disableInputs=true; } 其他的 $scope.disableInputs=false; $scope.selectChange=function(){ 开关($scope.paperSelection){ 案例“1700”: $scope.disableInputs=true; 打破 案件'1191': $scope.disableInputs=false; 打破 违约: 控制台日志(“无值”); } } })

A3纸张
A4纸
A5纸
条形码标签3排
所需的列数:

输入贴纸的数量:

输入标签的高度(以像素为单位):


您是
禁用的输入
不会随着
纸张选择的变化而变化。你得用手表把它包起来

只需在
选择
中添加
ng change
参数,即可更新
disableInputs
变量,如下所示:

<select ng-model="paperSelection" ng-init="paperSelection='1191'" ng-change="disableInputs = (paperSelection == 377.95)">


这是一个正在工作的打捞器


您的
功能被禁用输入不随
纸张选择的变化而变化。你得用手表把它包起来

只需在
选择
中添加
ng change
参数,即可更新
disableInputs
变量,如下所示:

<select ng-model="paperSelection" ng-init="paperSelection='1191'" ng-change="disableInputs = (paperSelection == 377.95)">


这是一个正在工作的打捞器


非常感谢!这很有帮助:)非常感谢!这很有帮助:)非常感谢。这很有帮助,非常感谢。这很有帮助。
<select ng-model="paperSelection" ng-init="paperSelection='1191'" ng-change="disableInputs = (paperSelection == 377.95)">