1

I tried to disable the future date in date picker but thing is it has been disable the month and the year.

following is the code.

    <html>
<head>
    <title>Week Calculation</title>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="css/jquery-ui.css" />

    <script src="JavaScript/jquery-1.10.2.js"></script>
    <script src="JavaScript/jquery-ui.js"></script>

</head>
<body>
    <form id="daterange">
        <p>Date1: <input type="text" id="datepicker1" name="date1"></p>
        <p>Date2: <input type="text" id="datepicker2" name="date2"></p>
      <p> <label> Enter search Text: </label> <input type="text" id="byrange" name="searchText"> </p>
        <p> <input type="submit" /></p>
    </form>
</body>

enter image description here

Anoop Joshi P
  • 25,373
  • 8
  • 32
  • 53
user993164
  • 157
  • 3
  • 15
  • see this id different question. even i posted with screenshot also. i want disable the future date but user can able to select the month and year drop down for some thing like previous year or previous month selection. – user993164 Nov 06 '15 at 10:10
  • reopened the question now. – Anoop Joshi P Nov 06 '15 at 10:10

1 Answers1

1

use

$("#datepicker").datepicker({ maxDate: new Date);

or

 $("#datepicker").datepicker({  maxDate: '0'});
Shailendra Sharma
  • 6,976
  • 2
  • 28
  • 48