Hi,
I want to set table date fields to accept only future date and today date. i have applied on below mentioned Code but this code only working on first row of table date field, other adding rows its not working. below screenshot for ref:
Please suggest the modify code to resolve this problem.
Code:
$(document).ready(function(){
var todaysDate = new Date(); // Gets today's date
// Max date attribute is in "YYYY-MM-DD". Need to format today's date accordingly
var year = todaysDate.getFullYear(); // YYYY
var month = ("0" + (todaysDate.getMonth() + 1)).slice(-2); // MM
var day = ("0" + todaysDate.getDate()).slice(-2); // DD
var minDate = (year +"-"+ month +"-"+ day); // Results in "YYYY-MM-DD" for today's date
// Now to set the max date value for the calendar to be today's date
$('.calendarDate input').attr('min',minDate);
});
Table Row:1
Table Row 2: future date not hiding on second row.