i trying angularjs can validate time field . how can validate dropdown field current time? in select option have given min={{currentdate | "hh:mm::ss"}}. not validating, below code
html page:
<h6 class="text-left">time<span class="error"> *</span></h6> <select class='select-button' name='time' id='time' ng-model='saverem.time' type='text' placeholder="select time" required min="08:00:00" > <option value="">select</option> <option value="08:00:00">08:00 am</option> <option value="08:15:00">08:15 am</option> <option value="08:30:00">08:30 am</option> <option value="08:45:00">08:45 am</option> <option value="09:00:00">09:00 am</option> <option value="09:15:00">09:15 am</option> <option value="09:30:00">09:30 am</option> <option value="09:45:00">09:45 am</option> <option value="10:00:00">10:00 am</option> <option value="10:15:00">10:15 am</option> <option value="10:30:00">10:30 am</option> <option value="10:45:00">10:45 am</option> <option value="11:00:00">11:00 am</option> <option value="11:15:00">11:15 am</option> <option value="11:30:00">11:30 am</option> <option value="11:45:00">11:45 am</option> <option value="12:00:00">12:00 pm</option> <option value="12:15:00">12:15 pm</option> <option value="12:30:00">12:30 pm</option> <option value="12:45:00">12:45 pm</option> <option value="13:00:00">01:00 pm</option> <option value="13:15:00">01:15 pm</option> <option value="13:30:00">01:30 pm</option> <option value="13:45:00">01:45 pm</option> <option value="14:00:00">02:00 pm</option> <option value="14:15:00">02:15 pm</option> <option value="14:30:00">02:30 pm</option> <option value="14:45:00">02:45 pm</option> <option value="15:00:00">03:00 pm</option> <option value="15:15:00">03:15 pm</option> <option value="15:30:00">03:30 pm</option> <option value="15:45:00">03:45 pm</option> <option value="16:00:00">04:00 pm</option> <option value="16:15:00">04:15 pm</option> <option value="16:30:00">04:30 pm</option> <option value="16:45:00">04:45 pm</option> <option value="17:00:00">05:00 pm</option> <option value="17:15:00">05:15 pm</option> <option value="17:30:00">05:30 pm</option> <option value="17:45:00">05:45 pm</option> <option value="18:00:00">06:00 pm</option> <option value="18:15:00">06:15 pm</option> <option value="18:30:00">06:30 pm</option> <option value="18:45:00">06:45 pm</option> <option value="19:00:00">07:00 pm</option> <option value="19:15:00">07:15 pm</option> <option value="19:30:00">07:30 pm</option> <option value="19:45:00">07:45 pm</option> <option value="20:00:00">08:00 pm</option> <option value="20:15:00">08:15 pm</option> <option value="20:30:00">08:30 pm</option> <option value="20:45:00">08:45 pm</option> <option value="21:00:00">09:00 pm</option> <option value="21:15:00">09:15 pm</option> <option value="21:30:00">09:30 pm</option> <option value="21:45:00">09:45 pm</option> <option value="22:00:00">10:00 pm</option> <option value="22:15:00">10:15 pm</option> <option value="22:30:00">10:30 pm</option> <option value="22:45:00">10:45 pm</option> <option value="23:00:00">11:00 pm</option> <option value="23:15:00">11:15 pm</option> <option value="23:30:00">11:30 pm</option> <option value="23:45:00">11:45 pm</option> <option value="00:00:00">12:00 am</option> <option value="00:15:00">12:15 am</option> <option value="00:30:00">12:30 am</option> <option value="00:45:00">12:45 am</option> <option value="01:00:00">01:00 am</option> <option value="01:15:00">01:15 am</option> <option value="01:30:00">01:30 am</option> <option value="01:45:00">01:45 am</option> <option value="02:00:00">02:00 am</option> <option value="02:15:00">02:15 am</option> <option value="02:30:00">02:30 am</option> <option value="02:45:00">02:45 am</option> <option value="03:00:00">03:00 am</option> <option value="03:15:00">03:15 am</option> <option value="03:30:00">03:30 am</option> <option value="03:45:00">03:45 am</option> <option value="04:00:00">04:00 am</option> <option value="04:15:00">04:15 am</option> <option value="04:30:00">04:30 am</option> <option value="04:45:00">04:45 am</option> <option value="05:00:00">05:00 am</option> <option value="05:15:00">05:15 am</option> <option value="05:30:00">05:30 am</option> <option value="05:45:00">05:45 am</option> <option value="06:00:00">06:00 am</option> <option value="06:15:00">06:15 am</option> <option value="06:30:00">06:30 am</option> <option value="06:45:00">06:45 am</option> <option value="07:00:00">07:00 am</option> <option value="07:15:00">07:15 am</option> <option value="07:30:00">07:30 am</option> <option value="07:45:00">07:45 am</option> </select> <span class='error' ng-show="remform.remtime.$dirty && remform.remtime.$invalid"> <span ng-show="remform.remtime.$error.required">select time</span> <span ng-show="remform.remtime.$error.min">time cannot older current date , time</span> </span> <button id="addreminder" type="submit" class="button button-block maple-button" ng-click="addreminder()" ng-disabled="((remform.time.$dirty && remform.remtime.$invalid)|| (remform.time.$pristine && remform.remtime.$invalid))"> submit </button>
js controller:
$scope.currentdate = new date();
Comments
Post a Comment