0

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!

Gisto
  • 887
  • 2
  • 16
  • 32

1 Answers1

0

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'); 
?>
Alex
  • 6,441
  • 2
  • 25
  • 26
  • Ahhh...hmm... The form I'm building would allow someone to update multiple rows at a time (eg, class1 - date; class2-date, etc.) so the name/id corresponds to the same column. Is there a way of achieving that? – Gisto Apr 10 '12 at 15:57
  • @Gisto - yes. Also you must make sure you js does not crash because it can affect functionality of all non-intrusive JS. – Alex Apr 10 '12 at 19:54