Bootstrap Datepicker in Modal Popup Window

Yet another datepicker jQuery plugin easily used in Bootstrap modal popup. The plugin has multi options, multi functions and multi languages to pick current, selected or filtered date.

Plugin Overview

Plugin: datepicker-in-bootstrap-modal
Author: Fengyuan Chen
Licence: MIT Licence
Published: March 24, 2019
Repository: Fork on GitHub
Dependencies: jQuery 3.3.1 or Latest version, Bootstrap 4.1.3
File Type: zip archive (HTML, CSS & JavaScript)
Package Size: 38 KB

How to Use Datepicker in Bootstrap Modal:

1. To getting started with this plugin, load the jQuery and Bootstrap framework.

<!-- jQuery -->
<script src=""></script>

<!-- Bootstrap CSS -->
<link rel="stylesheet" href="">

<!-- Bootstrap Js -->
<script src=""></script>

2. After this, include the datepicker’s javascript and CSS files.

<!-- Datepicker CSS -->
<link rel="stylesheet" href="css/datepicker.css">

<!-- Datepicker JS-->
<script src="js/datepicker.js"></script>

3. To create Bootstrap datepicker in modal popup, so build the HTML structure like below.

 <!-- Button trigger modal -->
    <button type="button" class="btn btn-primary" data-target="#modal" data-toggle="modal">
      Launch the demo

    <!-- Modal -->
    <div class="modal fade" id="modal" role="dialog" aria-labelledby="modalLabel" tabindex="-1">
      <div class="modal-dialog" role="document">
        <div class="modal-content">
          <div class="modal-header">
            <h5 class="modal-title" id="modalLabel">Datepicker</h5>
            <button type="button" class="close" data-dismiss="modal" aria-label="Close">
              <span aria-hidden="true">×</span>
          <div class="modal-body" style="height: 1000px;">
            <input type="text" class="form-control" data-toggle="datepicker">
          <div class="modal-footer">
            <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>

4. Initialize the plugin in jQuery document ready function so that datepicker activated.

 $(function() {
      autoHide: true,
      zIndex: 2048,


Leave a Reply

Your email address will not be published.


8 − two =

This site uses Akismet to reduce spam. Learn how your comment data is processed.