Hello,
I am trying to use Flatpickr to choose a date in one input field on a text form question. I have two inputs on the form, one for cell phone and another for Last Date on Campus. I only want the date picker to show up on the date question but it is showing up on both with the code below. Is there a way to only apply the date picker to a single input on a question form?
jQuery("#"+this.questionId+" .InputText").flatpickr({enableTime: false, altInput: true, altFormat: "m/d/yy", dateFormat: "m/d/yy", minDate:"2020-01", maxDate: new Date().fp_incr(0)});
Thank you for you help.
Solved
Flatpickr to choose date in text form
Best answer by TomG
Use .eq(0) for the first field or .eq(1) for the second field. For example:
jQuery("#"+this.questionId+" .InputText").eq(1).flatpickr({
enableTime: false, altInput: true,
altFormat: "m/d/yy", dateFormat: "m/d/yy",
minDate:"2020-01", maxDate: new Date().fp_incr(0)
});
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.
