在加载时,我保持第二个文本框被禁用。我正在验证第一个文本框输入,然后将占位符传递给第二个复选框。 同时我想启用第二个文本框字段。怎么做?
<label for="customerRequestId" class="col-sm-1 control-label">Product</label>
<div class="col-sm-2">
<input type="text" class="form-control" name="customerProduct" ng-model="customerProduct" ng-blur="validatecustomerProduct()"/>
</div>
<label for="customerPeriod" class="col-sm-2 control-label">date Period</label>
<div class="col-sm-2">
<input type="text" class="form-control ng-dirty ng-invalid ng-invalid-pattern ng-invalid-required" name="customerPeriod" placeholder="{{datePlaceholder}}"disabled="disabled"ng-model="customerPeriod" />
</div>
答案 0 :(得分:1)
查看ngDisabled - https://docs.angularjs.org/api/ng/directive/ngDisabled - 并使用与您需要的验证匹配的表达式。
<INPUT
ng-disabled="expression">
...
</INPUT>