I have a form that has the user input between 2-4 dates in a collection. If the difference between the user input date and the day the form is filled out is less than 15 days then I want the submit button to be hidden until the date field in the collection contains a valid number.
I have the following code
$(document).ready(function(){
$('.shiftdate').on('change','.date input',function(){
var total_days = $(this.find('.totaldays input').val());
if($(total_days < 15) {
$('.Submit').hide();
};
});
});
It isn't making the submit button to hide. Does anyone have any suggestions as to why it isn't working?