In a project, I have a dropdown menu with hard coded values and some input fields. I need to disable some of the inputs if a specific value is selected. I tried
This is my code (I have included only the relevant code)
<html ng-app="abc">
<head>
<link rel="stylesheet" href="style.css">
<script src="script.js"></script>
</head>
<body ng-controller="abcd">
<select ng-model="paperSelection" ng-init="paperSelection='1191'">
<option value="1700">A3 Paper</option>
<option value="1191">A4 Paper</option>
<option value="842">A5 Paper</option>
<option value="377.95">Barcode Sticker 3 in a row</option>
</select>
<p>Number Of Columns Needed : <input type="number" ng-model="numberOfColumns" placeholder="Number Of Columns" ng-disabled="disableInputs"></p>
<p>Enter the number of Stickers : <input type="number" ng-model="numberOfStickersNeeded" placeholder="Number of Stickers"></p>
<p>Enter Height of the Sticker (in px) : <input type="number" ng-model="heightOfSticker" placeholder="Enter Height" ng-disabled="disableInputs"></p>
</body>
</html>
This is my relevant script part.
angular.module('abc', []);
controller('abcd', function ($scope) {
if ($scope.paperSelection == 377.95) {
$scope.disableInputs === true;
}
else
$scope.disableInputs ===false;
}
);
This isn't working. I couldn't find out what's the problem with this.
Can anyone please help me with this.