Date/Time form element not working in JA_purity

aksraj 22 Mar, 2009
Hi,
this form element is not working for the JA_purity theme.When I click the field no calender turns up and I cant even type anything.Any suggestions?
GreyHead 22 Mar, 2009
Hi aksraj,

It works well with the ja-purity theme, so that isn't the problem. Sounds like a JavaScript conflict with something else on the page. Is the page on-line?

Bob
GreyHead 23 Mar, 2009
Hi aksraj,

OK, so please can you post a link so that I can look at it?

Bob
GreyHead 23 Mar, 2009
Hi aksraj,

On the Autogenerated tab of your form, near the foot, you'll find an Date Fields Names box; please enter

date_7,date_9,date_11

in there and save the form.

Normally ChronoForms adds these automatically, I have no idea why it didn't happen here.

Bob
aksraj 23 Mar, 2009
Hi,
Its already there
Date Fields names: date_9,date_11,date_7
E.g: date_1,date_2
GreyHead 23 Mar, 2009
Hi askraj,

Is Load Chronoforms CSS/JS Files? set to Yes in the General Tab?

Bob
aksraj 23 Mar, 2009
Hi,

Its set to yes
GreyHead 23 Mar, 2009
Hi askraj,

Pleae try adding this code to the beginning of the Form HTML box. ChronoForms should automatically add this code to initialise the calendars, I have no idea why it's not happening on your site.
<?php
$script = "";
$datefieldsnames = array('date_7', 'date_9', 'date_11');
foreach ($datefieldsnames as $datefieldsname ) {
  $script .= "
    myCal_".$datefieldsname." = new Calendar(
      { $datefieldsname: 'd/m/Y' }, { classes: ['dashboard'] 
    });"
}
$doc =& JFactory::getDocument();
$doc->addScriptDeclaration( "window.addEvent('domready', function() { 
$script 
});");
?>

Bob
aksraj 23 Mar, 2009
Hi,
I'm getting an error,
Parse error: parse error, unexpected '}' in /home2/osslab/public_html/joomla/plugins/content/chronocontact.php(342) : eval()'d code on line 9

Its weird because it was working a couple of days ago,but i've been adding so much to the website i never noticed when it stopped working.
GreyHead 23 Mar, 2009
Hi aksraj,

Line 8 needs an extra ;

});";

Bob
aksraj 23 Mar, 2009
The code you gave is actually redundant.I've noticed when I click the form directly the date appears but when I insert it in an article it doesnt work.Adding your code gave two date icons on the form but none when inserted in the article.
GreyHead 23 Mar, 2009
Hi aksraj,

Ah, you forgot to mention that you are using the PlugIn and I didn't notice the URL. Do you have the latest version of the Mambot/Plugin?

Bob
aksraj 23 Mar, 2009
I have the 0.8/V 3.0 that came with joomla

edit: i uninstalled and put a new version.it works now! thanks for taking the trouble.sorry to have kept you in the dark for so long...
This topic is locked and no more replies can be posted.