html - Validate date field -
i trying disable save button untill date not picked. disabled not able enbale untill dont press key keyboard.please tell me doing wrong , in advance.
<div class = "form-group" ng-class="{ 'has-error' : form.fromtime.$invalid && !form.fromtime.$pristine }"> <label = "fromtime"> time: <img src = "images/required.gif" alt = "required" class = "required-star"> </label> <div class='input-group date' id='fromtime' > <input type='text' class="form-control" name="fromtime" ng-model = "fromtime" required /> <span class="input-group-addon"> <span class="glyphicon glyphicon-calendar"></span> </span> </div> <p ng-show="form.fromtime.$invalid && !form.fromtime.$pristine" class="help-block">from time required.</p> </div> <button type="button" class="col-sm-2 btn btn-primary" ng-click="schedulecall()" style="margin-left:10px;" ng-disabled="form.$invalid"> save </button>
change:
ng-disabled="form.$invalid"
to:
ng-disabled="form.fromtime.$invalid"
Comments
Post a Comment