Posts

Showing posts with the label bootstrap-datepicker

Validate date field on focusout with jquery-validation

Validate date field on focusout with jquery-validation Date Input Field not valid, When first time selecting the date. Its showing required error message, because of field have an empty value( check console log ). But field will be valid on second change. Notes: A cause is that date input field loses focus when picking the date (click event). But the date populates only later changed when the click event happens. But validator will validate field on focus out event. I'm validating a form using Jquery Validation, using bootstrap-datepicker for Widget. ^^for Better UX Run code snippet on full-page ;) or jsfiddle from @Sparky / @Vignesh ans: Yes, its a workaround for this, We can use change/hide/changeDate(module attribute) event handler. It gets triggered once the input values have been set. But the problem is whenever we pick from year->month->date each clicks in the picker, removes focus from input and focusout event fired and showing the error message until choosing ...

Angularjs+jquery bootstrap-datepicker delegate not firing on first click

Angularjs+jquery bootstrap-datepicker delegate not firing on first click I have tried adding the datepicker dynamically on button click and I have delegated the datepicker click which is not working on the first click its getting fired on the second click the code I have tried are the following $scope.add = function() { var body =angular.element(window.document.body); body.append(` <div class="input-group date"> <input class="form-control input-sm" placeholder="dd/mm/yyyy"type="text"> <span class="input-group-addon"> <span class="fa fa-calendar"></span> </span> </div> `); } $(document).delegate("div.input-group.date", "click", function(){ $(this).datepicker({autoclose: true,orientation:"top"}); }); I couldn't find out the reason, thanks ...