WordPress use built in date picker in any textfield

To add Jquery DatePicker in any textfield ,add following php code to to top of the page .

<?php
wp_enqueue_script('jquery-ui-datepicker');
wp_enqueue_style('jquery-style', 'http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.2/themes/smoothness/jquery-ui.css');
?>

Input field looks like below


<input type="text" id="dob" name="dob" value=""/>

Finally put below js code


<script>
jQuery(document).ready(function() {
    jQuery('#dob').datepicker({
        dateFormat : 'dd-mm-yy',
		changeMonth: true,
      	changeYear: true,
		 yearRange: "1905:2000"
    });
});
</script>

Visit us for more WordPress tutorials and
PHP ,Drupal, WordPress, Magento training .