Hi,
I have a searching bar on my website where people can select check-in and check-out dates on two different date pickers.
When someone is selecting the check-in date in the first date picker, I would like to automatically open the calendar of the other date picker.
Can someone help me with this function?
I have looked in the documentation and nothing works.
Thank you!
Jérôme
Hello @info98612
I suggest using the onChange() event handler on the first date picker to focus() on the second one.
const $chIn = $w('#checkInDP');
const $chOut = $w('#checkOutDP');
$chIn.onChange(() => {
$chOut.focus();
})
Please note: Focusing on an element such as a dropdown menu or a date picker might not actually open it.
Hope this helps~!
Ahmad
Thank you @ahmadnasriya for your help, I had already tested it and unfortunately, it does not work. It only adds a bar in the check out field like if I could write something, but no calendar.
I see … I’m afraid there’s no way to open it, unfortunately.