Programmatically switching dates inside the droplet via JS?
Hello!
I would like to be able to switch calendar dates inside the booking droplet from javascript on the containing page. Is this something that the droplet supports? Maybe using something like: https://developer.mozilla.org/en-US/docs/Web/API/Window/postMessage ?
My goal would be to hide the calendar, and instead create a list of clickable dates that I could use to "remote control" the droplet, triggering the same event that happens when you click on a date on the calendar.
thanks!
I would like to be able to switch calendar dates inside the booking droplet from javascript on the containing page. Is this something that the droplet supports? Maybe using something like: https://developer.mozilla.org/en-US/docs/Web/API/Window/postMessage ?
My goal would be to hide the calendar, and instead create a list of clickable dates that I could use to "remote control" the droplet, triggering the same event that happens when you click on a date on the calendar.
thanks!
Comments
Thank you for using our forums!
I am glad you have found a solution that works for you. While I cannot really provide much support for custom code, it should also be possible to alter the Droplet iframe's 'src'. Changing the 'src' should cause the iframe to reload.
- get the Droplet iframe element
- get the iframe 'src'
- use the 'src' to create the new URL with the new date
- change the iframe 'src' to the new URL
- the iframe reloads automatically
I hope this helps, and please let me know if you have any more questions.All the best,
Chase - Checkfront Support Team
https://www.giroola.com/tours/mountain-bike-tours/day-out-e-bike-langhe-region?date=20180915