Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR HTML

disable dates before today in input type date

<html>
   <head> 
      <meta name="viewport" content="width=device-width, initial-scale=1"> 
      <script type="text/javascript">
        window.onload=function(){
          //from www.java2s.com
          var today = new Date().toISOString().split('T')[0];
          document.getElementsByName("setTodaysDate")[0].setAttribute('min', today);
      }
      </script> 
   </head> 
   <body> 
      <input name="setTodaysDate" type="date">  
   </body>
</html>
Source by www.java2s.com #
 
PREVIOUS NEXT
Tagged: #disable #dates #today #input #type #date
ADD COMMENT
Topic
Name
4+3 =