About Me

My photo

I am Ram, a Web Designer and Developer.   More than 4  years of experience in software development. Created complex back-end management systems including content management, e-commerce, customer relations and communication interfaces. The projects based on PHP in conjunction. PHP, SQL, JavaScript, AJAX, XHTML, CSS (Responsive), I help people make beautiful websites, functional applications and seamless user experiences.

Friday, 18 September 2015

Datepicker from date to date validation using jquery

<label for="from">From</label>
<input type="text" id="from" name="from" />
<label for="to">to</label>
<input type="text" id="to" name="to" />
<link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" />
<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
<script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>

<script>
$(function () {
$("#from").datepicker({
maxDate:+0,
changeMonth: true,
dateFormat: 'dd/mm/y',
numberOfMonths: 1,
onClose: function (selectedDate) {
$("#to").datepicker("option", "minDate", selectedDate);

}
});
$("#to").datepicker({
maxDate:+0,
changeMonth: true,
dateFormat: 'dd/mm/y',
numberOfMonths: 1,
onClose: function (selectedDate) {
}
});
});</script>

Demo

No comments:

Post a Comment