Forums

Calendar Plugin?

Savant 28 Apr, 2008
Hi there,

first: ChronoForms ROCKS! A MUST HAVE for every Joomla-Installation out there. Testing it right now and _will_ place a purchase.

Now my Question:

Is there a calendar plugin out there, so that people who have to fill in a form chose a date from a calender-like layout to fill a date / time field and that also integrates with ChronoForms?

I am using Joomla 1.5.2 and ChronoForms (newest build).
GreyHead 28 Apr, 2008
Hi Savant,

Glad that you like ChronoForms :-)

You cna use the Joomla calendar code OK. There are some wrinkles but if you search the forums here you should find examples for both Joomal 1.0.x and 1.5

Bob
Savant 20 May, 2008
Hi there,

i finally found something in the forum and in the Joomla! 1.5 API. The API tells me to add something like:

JHTML::_

calendar (line 278)

Displays a calendar control field
void calendar (string $value, string $name, string $id, [string $format = '%Y-%m-%d'], [array $attribs = null])

* string $value: The date value
* string $name: The name of the text field
* string $id: The id of the text field
* string $format: The date format
* array $attribs: Additional html attributes

So i added the following line to my form in ChronoForms

JHTML::_('calendar','', 'datum', 'datum',
$format = '%m.%d.%Y',array('class'=>'inputbox',
'size'=>'25',  'maxlength'=>'19'));
to add the Button for a calendar form. After testing i found, that _something_ is working. But something is still wrong seamingly.

This is the error i get:

calendar.setup:
Nothing to setup (no fields found).
Please check your code!

To be honest: i don't know, what that means. Can anybody help me, or tell me, how to use the API right to produce this button, that opens a calendar dialog?

Thanks a lot!
GreyHead 20 May, 2008
Hi Savant,

'Serach the forums here' means 'search the forums here' I did that this morning and found this code that works perfectly in Joomla 1.5
$document =& JFactory::getDocument(); 
$js_path = JURI::base().'includes/js/'; 
$document->addScript($js_path.'joomla.javascript.js'); 
$document->addScript($js_path.'calendar/calendar.js'); 
$document->addScript($js_path.'calendar/calendar_mini.js'); 
$document->addScript($js_path.'calendar/lang/calendar-en-GB.js'); 
$document->addStyleSheet($js_path.'calendar/calendar-mos.css'); 
?>
to initialise the JavaScript and[code]<div>
<label for="arrival_date"><strong>Arrival Date</strong></label>
Savant 20 May, 2008
Hi GreyHead,

i _did_ find this code also, but - for some reason - i thought this is code that works only in Joomla! 1.0.x. Don't ask me why, but maybe its because i did not find this code in the 1.5 API... Sometimes people are dumb w/o knowing it. Heh. I should have just tested it...

Will check that out and try if it works. Thanks for the hint!
GreyHead 20 May, 2008
Hi Savant,

Both sets of code are in the forums somewhere - anything with Jxxx in it is most likely for Joomla 1.5

Bob
Savant 20 May, 2008
I see! I am not too familiar with the Joomla internals right now. I hope to dive deeper into it in the future. But its not that easy, if your not that kickass php-coder you want to be. I lost track when php started to be object oriented... Really need to get into that because nobody wants lame spaghetti code anymore :blush:

Last time i coded there still were numbers for every line of code, and you only had GOTO an GOSUB to do anything outside (or inside) the main code... So: there is a lot to learn.

10 REM **** SelfSlap ****
20 A$="SAVANT"
30 PRINT A$, " slaps himself!"
40 GOTO 30

...you know what i mean now. *G*
Savant 20 May, 2008
Hi again,

just stopped by to state, that it works pretty well with this code in IE (tested with IE6). But, for some reason, it does not work in Firefox 2.0.14 (JS enabled). Will try to find another solution and post it here, once i found it.
GreyHead 20 May, 2008
Hi Savant,

Works fine here in 2.0.0.14

What does FireBug show?

Bob
Savant 20 May, 2008
Hi there again,

i re-did it all and used Firebug to find out. Seemingly i missed an ID-Tag in the code, so the JS-Code could not work properly. Prolly did something wring while copy and pasting the stuff into my code.

Works perfectly now.

BTW: Firebug was a great hint. WHAT a cool tool. This + the developer tools is the best combination of tools i've seen so far.

Sorry for being a lamer-pain again. Another time you saved my ass. Registered Chronoforms some minutes ago, btw. Its really worth it (more than that).

Be sure to get a really, really good comment/rating on joomla extensions repository. If you ask me, its really the best extension ever. And i did not even use all the cool features now. Chronoforms will save me hours and hours of work. So - you made me really happy! :laugh:
GreyHead 21 May, 2008
Hi Savant,

Thanks & good luck!

Bob
This topic is locked and no more replies can be posted.