I have a two text inputs for dates, one right after the other on the same page, 'from date' and 'to date'. Both use jquery datepicker for the calendar widget.
//From Date
jQuery("#"+this.questionId+" .InputText").each(function(index){
jQuery(this).datepicker({
dateFormat : 'mm/dd/yy'
})
});
jQuery("#"+this.questionId+" .InputText").prop("readonly", true);
//To Date
jQuery("#"+this.questionId+" .InputText").each(function(index){
jQuery(this).datepicker({
dateFormat : 'mm/dd/yy',
minDate : /*whatever was entered as 'from date' + 1 day*/ })
});
jQuery("#"+this.questionId+" .InputText").prop("readonly", true);
I want to use the 'from date' (+1 day) as the 'mindate' for the 'to date', so that the user cannot select a 'to date' before the 'from date'. I've tried embedded data but I think that does not work because these questions are right after each other on the same page. I know this is not the best way to do date input, but I need it to stay like this. Any and all help is appreciated.
Thank you.
Best answer by ahmedA
View original