---
title: "Bootstrap datepicker hide after selection"  
description: "Bootstrap datepicker hide after selection"  
author: "Anonymous User"  
published: 2018-05-23  
updated: 2018-06-06  
canonical: https://www.mindstick.com/forum/34490/bootstrap-datepicker-hide-after-selection  
category: "jquery"  
tags: ["jquery", "bootstrap"]  
reading_time: 1 minute  

---

# Bootstrap datepicker hide after selection

I want to hide the [date picker](https://www.mindstick.com/blog/627/date-picker-using-bootstrap-in-asp-dot-net) after date [selection](https://www.mindstick.com/blog/60/populate-records-in-second-listbox-according-to-the-selection-in-first-list-box)

```
$('#dp1').datepicker({
    format: 'mm-dd-yyyy',
    startDate: '-15d',
    autoclose: true,
    endDate: '+0d' // there's no convenient "right now" notation yet
});
```

Any help would be appreciated.

## Replies

### Reply by Prakash nidhi Verma

if u want to hide the date picker after date selection than attempting to type in the date can cause that behavior which is you did not use. so, use autoclose it's helpful.

```
$('#input').datepicker({autoclose:true});
```

Another way for write to datepicker is shown below:

locales , without icon , linked picker ,disabled days.

use functions for date pickers.

```
$(function () {
        $('#datetimepicker').datetimepicker();
        $('#datetimepicker').datetimepicker({
            useCurrent: false
        });
```

Happy Coding :)

\

### Reply by Manish Kumar

You can use event changedate() to keep track of when the [date](https://yourviews.mindstick.com/story/3869/propose-day-2024-exciting-date-ideas-for-you-and-your-partner) is changed together with datepicker('hide') method to hide the datepicker after making selection:

```
$('yourpickerid').on('changeDate', function(ev){
    $(this).datepicker('hide');
});
```

\


---

Original Source: https://www.mindstick.com/forum/34490/bootstrap-datepicker-hide-after-selection

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
