Pages

Monday 23 June 2014

calender from date to date validator wth JQuery

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <meta charset="utf-8">
  <title>jQuery UI Datepicker - Default functionality</title>
  <link rel="stylesheet" href="//code.jquery.com/ui/1.10.4/themes/smoothness/jquery-ui.css">
  <script src="//code.jquery.com/jquery-1.10.2.js"></script>
  <script src="//code.jquery.com/ui/1.10.4/jquery-ui.js"></script>
  <link rel="stylesheet" href="/resources/demos/style.css">
   <script>
  $(document).ready(function(){
      $("#datepicker").datepicker({
        minDate: 0,
        maxDate: "+60D",
        numberOfMonths: 2,
        onSelect: function(selected) {
            $("#Todate").datepicker("option", "minDate", selected)
        }
    });
  $("#Todate").datepicker({
        minDate: 0,
        maxDate:"+60D",
        numberOfMonths: 2,
        onSelect: function(selected) {
            $("#datepicker").datepicker("option", "maxDate", selected)
        }
    }); 
});
</script>
  <script>
      $(function () {
          $("#datepicker").datepicker();
      });
  </script>
   <script>
       $(function () {
           $("#Todate").datepicker();
       });
  </script>
</head>
<body>

<p>From Date: <input type="text" id="datepicker"></p>
 To Date :<input type="text" id="Todate"></p>

</body>
</html>