asked on February 9, 2017
•
Show version history
hi everyone.
i have a form where the previous dates from today must be hidden in the first date picker and the second date picker must not show dates previous to the first selected date.
The form is working for the first row but i can't get the code to work for the other rows that follow when i "add" a new row.
Can anyone assist me with this Please?
here is my current code :
$(document).ready(function(){ function updateMinimumEndDate () { var minimum = $('.DepartDate input').val(); var minSplit = []; minSplit = minimum.split("/"); var newMin = (minSplit[2]+"-"+minSplit[0]+"-"+minSplit[1]); $('.ReturnDate input').attr('min',newMin); } $('.DepartDate input').change(updateMinimumEndDate); }); $(function() { $(document).ready(function () { var todaysDate = new Date(); var year = todaysDate.getFullYear(); var month = ("0" + (todaysDate.getMonth() + 1)).slice(-2); var day = ("0" + todaysDate.getDate()).slice(-2); var minDate = (year +"-"+ month +"-"+ day); $('.DepartDate input').attr('min',minDate); }); });
0
0