0

I want to disable the dates after the current date in my program. I have a date picker written in JavaScript.

sorry for my any mistake ..actually here is I am new

Here is my code

<html>
<head>
    <link rel="stylesheet" href=" jquery.datetimepicker.min.css">
    <script src=" jquery.js"></script>
    <script src=" jquery.datetimepicker.full.js"></script>
</head>
<body>
<input id="datetime">
</body>
<script type="text/javascript">
    $("#datetime").datetimepicker({
        step: 1
    });
    $("#datetime").datepicker({minDate: new Date()});
</script>
</html>

I am trying so many datepicker query but all are not working ...backdates are not disable ...so can you help me

DarkBee
  • 16,592
  • 6
  • 46
  • 58

2 Answers2

0

jQuery datepicker is implemented to use

$( "#datetime" ).datepicker({ minDate: 0});

If your jQuery plugin minDate functionality is same, you will disable past dates.
Read more here

-1

First your opening body tag is not complete and the other answer to your question is add disabled to your input field

Harsh Patel
  • 11
  • 1
  • 3