jQuery: Date Range Validation

Here's a quick example on how to disable previous dates based on the date selected from the first calendar date. You can see the actual demo here: http://jsfiddle.net/j3w726r0/
  1. <script type="text/javascript">  
  2.         $(function () {  
  3.             $("#<%=TextBox1.ClientID%>").datepicker({  
  4.                 changeMonth: true,  
  5.                 changeYear: true,  
  6.         onSelect: function(selected) {  
  7.                       $("#<%=TextBox2.ClientID%>").datepicker("option","minDate", selected)  
  8.                 }  
  9.             });  
  10.             $("#<%=TextBox2.ClientID%>").datepicker({  
  11.                 changeMonth: true,  
  12.                 changeYear: true,  
  13.         onSelect: function(selected) {  
  14.                       $("#<%=TextBox1.ClientID%>").datepicker("option","maxDate", selected)  
  15.                 }  
  16.             });  
  17.         });     
  18. </script>