jQuery Datepicker close datepicker after selected date

HTML
<div class="container">
  <div class="hero-unit">
    <input type="text" class="dp" placeholder="click to show datepicker" id="example1">
  </div>
</div>
jQuery (alternativ way)
$(document).ready(function () {
    $('#example1').datepicker({
      format: "dd/mm/yyyy"
    });

    $('.dp').on('change', function(){
        $('.datepicker').hide();
    });

});
this is all you have to do :)
HERE IS A FIDDLE to see whats happening.

Comments

Popular posts from this blog

Script For Login, Logout and View Using PHP, MySQL and Bootstrap

PHP Ajax Login Validation Tutorial

Hyperledger Development with in 10 days — Day 6