Hi,
I need to retrieve module parameters and update the document with a script defining a parameter of my main jQuery script that controls the form.
First I created a Custom Code action at the OnLoad event with the following code:
The problem is that the above code works anywhere else but not inside Custom Code action. Actually the first line ( $module = JModuleHelper::getModule('mod_webhotelier') ) returns an empty object.
Is there any other way to retreive module params?
Thanks,
George
I need to retrieve module parameters and update the document with a script defining a parameter of my main jQuery script that controls the form.
First I created a Custom Code action at the OnLoad event with the following code:
<?php
$module = JModuleHelper::getModule('mod_webhotelier');
$modparams = new JRegistry();
$modparams->loadString($module->params);
$sDate = $modparams->get('startdate');
$doc = JFactory::getDocument();
$doc->addScriptDeclaration('(function($){ $.startDate = "' . $sDate . '"; })(jQuery);');
?>
The problem is that the above code works anywhere else but not inside Custom Code action. Actually the first line ( $module = JModuleHelper::getModule('mod_webhotelier') ) returns an empty object.
Is there any other way to retreive module params?
Thanks,
George