Hi Greyhead
Please advise me on how to make it work
In form I have dynamic dropdown and the next Custom code on load
How to put this retrieved options to the dropdown?
Please advise me on how to make it work
In form I have dynamic dropdown and the next Custom code on load
<?phpURL in the code above has a valid json output
$doc = JFactory::getDocument();
JHtml::_('jquery.framework');
$doc->addStylesheet(JUri::root().'https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.6-rc.0/css/select2.min.css');
$doc->addScript(JUri::root().'https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.6-rc.0/js/select2.min.js');
$script = "
jQuery(document).ready(function(jQ) {
jQ('#dropdown2').select2({
ajax: {
url: 'https://my.site.org/index.php?option=com_chronoforms5&chronoform=123&tmpl=component&tvout=ajax',
dataType: 'json'
}
});
});
";
$doc->addScriptDeclaration($script);
?>
How to put this retrieved options to the dropdown?