I want to close datepicker when click on day. How is this possible in Bootstrap Datepicker?
Here is the fiddle:
http://jsfiddle.net/kGGCZ/17/
$('#dob').datepicker(
{
endDate:ageDate
}
);
You the auto-close property of the bootstrap date-piker like below
$('#dob').datepicker(
{
endDate:ageDate,
autoclose: true
}
);
I have already updated your js-fiddle
Updated fiddle
Note that if you are using Stefan Petre's original version of the Bootstrap Datepicker, the autoclose property will [as of this writing] not work. In this case, you should do something like this:
$('#myDate').datepicker().on('changeDate', function (e) {
$('#myDate').datepicker('hide');
});
If you're using eternicode's forked version, the autoclose property will work.
initialize your date picker with option 'autoclose'
$('#dob').datepicker(
{"autoclose": true});
or you can close date picker by using following code also
$('#dob').datepicker().on('changeDate', function (ev) {
$('#dob').hide();
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With