Question

I am trying to create a booking system. How do I show the selected date in 2 select boxes instead of an input which is the default in Joomla as in the image below?

alt text

I tried searching the calendar-setup.js file but couldn't locate any function to do this. I want to bind the click event of the calendar to the select boxes.

Any suggestions?

Was it helpful?

Solution

That could get a bit hairy. The calendar most likely passes a string back in a format specified by the calendar's options. If this is the case, matching the format string to the values for the items in the dropdown will likely do the trick. Something to the effect of:

function clickCallback(clickValue){
   document.getElementByID().selectedIndex = clickValue;
}

This trick is figuring out how you are going to get the index and the values returned to line up.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top