Bootstrap Date Picker in Availability Check Form

When working on Hotel website design, we may need ‘Availability Check Form’. We can check how to add Availability Check Form with Bootstrap Date Picker.

1. Create the html markup for Availability Check. You can use the Bootstrap form builder at

      <form class="form-inline" method="post" action="availability.php"  name="availability">
          <div class="form-group input-group date">
          <input id="checkin" name="checkin" type="text" class="form-control input-lg" placeholder="Check In" required><span class="input-group-addon"><i class="glyphicon glyphicon-th"></i></span>

          <div class="form-group input-group date">
          <input id="checkout" name="checkout" type="text" class="form-control input-lg" placeholder="Check Out" required><span class="input-group-addon"><i class="glyphicon glyphicon-th"></i></span>

          <div class="form-group">
          <input id="adults" name="adults" type="text" class="form-control input-lg" placeholder="No.of Adults" required>

          <div class="form-group">
          <input id="childrens" name="childrens" type="text" class="form-control input-lg" placeholder="No.of Childrens" required>
          <button type="submit" id="submit" name="submit" class="btn btn-success input-lg">Check Availability</button>

2. Include jQuery library and datepicker plugin on the web page

<script src=""></script><!--no needed if your site already uses jQuery library -->
<link href="" rel="stylesheet">
<script src=""></script>

3. There are a number of possible plugin options described in the documentation. For our purposes, we specify the format of the date, define a container element, highlight today’s date, and close the interactive popup after a date has been chosen. All that, all that is left is to initialize the plugin.

The complete javascript code we’ll use looks like this:

    format: "yyyy/mm/dd",
    startDate: "2016-03-01",
    endDate: "20120-01-01",
    todayBtn: "linked",
    autoclose: true,
    todayHighlight: true
Related Posts Plugin for WordPress, Blogger...