I found the following javascript in a previous post and it works for me to limit the date picker to not allow dates prior to the current date.
However, my datepicker is in a table. And this script only works on the first row of the table. How would I adjust it to cover all newly added rows? q9 is the table.
Thanks.
/*Limit the starting date of the date picker.*/
$(function() {
$(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 min date value for the calendar to be today's date
$('#q9 input').attr('min',minDate);
});
});