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!

Comments

  • (I found that I can destroy and rerender the widget, doing what I wanted)
  • Hi vermario,

    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. 
    1. get the Droplet iframe element
    2. get the iframe 'src'
    3. use the 'src' to create the new URL with the new date
    4. change the iframe 'src' to the new URL
    5. 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
  • Thanks for the suggestion, I went with recreating the iframe and it seems to work:

    https://www.giroola.com/tours/mountain-bike-tours/day-out-e-bike-langhe-region?date=20180915
Sign In or Register to comment.