Вопрос

Trying to have more than one popup calendar in a component I'm building but only the first one works.

<?php echo JHTML::calendar($this->escape($item->datepassed), 'teacher_datepassed', 'teacher_datepassed', '%Y-%m-%d'); ?>

Some research though can't seem to find an example of more than one that worked:

http://docs.joomla.org/JHtml::calendar/1.6
http://www.zriel.com/joomla/25-how-to-add-pop-up-calendar-in-backend-of-joomla

Thoughts?

Thanks!

Это было полезно?

Решение

You have to use different names & ids for the calendars, otherwise javascript will crash. Also, make sure you dont have any other JS errors because it can cause things not to initialize properly. User Firebug Console or Chrome Console.

<?php 
echo JHtml::calendar($item->datepassed, 'cal1_name', 'cal1_id'); 
echo JHtml::calendar($item->datepassed, 'cal2_name', 'cal2_id'); 
?>
Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top