html - How can i disabled selection based on ng-model? -
i want disabled proxy input field selection till attestor selected , both fields readonly, if attestor not selected user should not able select proxy. new angularjs please how can implement logic using ng-model.
main.html
<div class="row"> <div class="form-group col-md-6"> <label for="attestorworker" class="col-md-4">attestor:</label> <div class="col-md-8"> <input type="text" class="form-control" id="attestorworker" required ng-model="attestordto.attestorworker" name="attestorworker" ng-click="openattestorsearch()" readonly="readonly"/> </div> </div> </div> <div class="row"> <div class="form-group col-md-6"> <label for="proxyworker" class="col-md-4">proxy :</label> <div class="col-md-8"> <input type="text" class="form-control" id="proxyworker" required ng-model="attestordto.proxyworker" name="proxyworker" ng-click="openproxysearch()" readonly="readonly"/> </div> </div> </div>
you can use ng-disabled attribute.
<input type="text" class="form-control" id="proxyworker" required ng-model="attestordto.proxyworker" name="proxyworker" ng-click="openproxysearch()" readonly="readonly" ng-disabled="!attestordto.attestorworker"/>
changing:
ng-disabled="!attestordto.attestorworker"
to condition want disabled
Comments
Post a Comment