Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

set min date field to current date

// Use Javascript
var today = new Date();
var dd = today.getDate();
var mm = today.getMonth()+1; //January is 0 so need to add 1 to make it 1!
var yyyy = today.getFullYear();
if(dd<10){
  dd='0'+dd
} 
if(mm<10){
  mm='0'+mm
} 

today = yyyy+'-'+mm+'-'+dd;
document.getElementById("datefield").setAttribute("min", today);
Comment

PREVIOUS NEXT
Code Example
Javascript :: how to map objects in react native 
Javascript :: diff two arrays javascript 
Javascript :: create react app cmd 
Javascript :: remove validators angular 
Javascript :: react forwardref 
Javascript :: update array of object using other array javascript 
Javascript :: dropzone get response 
Javascript :: discord.js v13 intents 
Javascript :: javascript constructor function vs factory function 
Javascript :: how to read file extension in a folder in node js 
Javascript :: chart.js chart is not defined 
Javascript :: laravel jquery csrf 
Javascript :: for element in string js 
Javascript :: generate random date 
Javascript :: angular {{}} new line 
Javascript :: [Error - 10:52:45 PM] Failed to load jshint library 
Javascript :: string includes substring javascript 
Javascript :: discord.js remove reaction 
Javascript :: nodejs file exists 
Javascript :: react material ui classname 
Javascript :: javascript htmlentities 
Javascript :: foreach object javascript 
Javascript :: js strict mode 
Javascript :: material ui color background 
Javascript :: trigger play video jquery 
Javascript :: how to store an entire object in cookies javascript 
Javascript :: ignore node modules 
Javascript :: json multiple records 
Javascript :: check if element is visible or hidden in dom 
Javascript :: basic server on node.js 
ADD CONTENT
Topic
Content
Source link
Name
7+3 =