How to auto hide bootstrap date-picker after selecting date?

I am using Bootstrap datepicker in my web-application, but once I have selected date, date-picker is not hiding, how can I auto-hide date-picker once date is selected? Here is the date-picker Javascript code, which I am  using

     <link href="//" rel="stylesheet" />
 <script src="//"></script>
    <script src="//"></script>

                format: 'mm/dd/yyyy'


Asked by:- neena
: 6958 At:- 7/25/2020 9:25:10 AM
Bootstrap bootstrap date-picker auto-hide-once-selected

2 Answers
profileImage Answered by:- vikas_jk

You can simply use "autoclose:true" property of bootstrap date picker, to close it after selection, here is an example



If you want to close it on date changed event call, you can do it as below

$('.datepicker').on('changeDate', function(event){
At:- 7/31/2020 12:56:09 PM

profileImage Answered by:- pika

For bootstrap datepicker, you can auto-hide datepicker as below

    format: 'dd/mm/yyyy',
}).on('changeDate', function(e){

Auto-hide datepicker for jQuery Datepicker, use the below code

    format: "dd/mm/yyyy",
    autoHide: true


At:- 1/24/2022 9:25:44 AM

Login/Register to answer
Register directly by posting answer/details

Full Name *

Email *

By posting your answer you agree on privacy policy & terms of use