<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>jQuery UI Datepicker - Default functionality</title>
<link rel="stylesheet" href="//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css">
<script src="//code.jquery.com/jquery-1.10.2.js"></script>
<script src="//code.jquery.com/ui/1.11.4/jquery-ui.js"></script>
<link rel="stylesheet" href="/resources/demos/style.css">
<script>
$(function () {
$("#datepicker1").datepicker();
});
</script>
<script>
$(function () {
$("#datepicker2").datepicker();
});
</script>
</head>
<body>
<p>Date 1: <input type="text" id="datepicker1"></p>
<p>Date 2: <input type="text" id="datepicker2"></p>
</body>
</html>
There are two date pickers in my code here. What I want is to disable dates when I select a date from the first date picker. That is suppose if I select date like 15/01/2015 from the first date picker. Now in the second date picker all the dates after 15/01/2015 will be disabled. But the dates before 15/01/2015 will be enabled in the second date picker.
How can I do that?