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

Real-Time Web Interface to MQTT using Socket.io and Node.js

Customize radio buttons and checkboxes with CSS sprites