Hi guys,
i set up a custom search form using CC V4...
now i would like to insert a double drop down (the items to be shown in the second drop down have to depend on what have been selected in the first one)...
i followed lots of tutorials but it seems to me that ajax does not work with CC...
ain't it true?
is there a way to make it working?
Tks!
Federico
i set up a custom search form using CC V4...
now i would like to insert a double drop down (the items to be shown in the second drop down have to depend on what have been selected in the first one)...
i followed lots of tutorials but it seems to me that ajax does not work with CC...
ain't it true?
is there a way to make it working?
Tks!
Federico
Hi Federico,
You are right that the CC search form has limited functionality. But you can link a ChronoForm to the CC Listing and use that as your search form; the Ajax should work OK then.
Bob
You are right that the CC search form has limited functionality. But you can link a ChronoForm to the CC Listing and use that as your search form; the Ajax should work OK then.
Bob
that's perfect bob!
now it works but i have two other questions:
this is the code i use to make double drop down working
and i guess that the part of code that shows requested data in the second drop down is this:
I really don't understand how it works cause i don't know anything about ajax...
Could you kindly explain to me how to show data in the drop down list as NAME - CITY and how to make the form consider the cf_created_by correspondent to the NAME - CITY selection?
Thanks in advance...
Federico
now it works but i have two other questions:
this is the code i use to make double drop down working
<?php
$district =& JRequest::getString('sid', '', 'post');
if ( $district ) {
$db =& JFactory::getDBO();
$query = "
SELECT `name`,`city`
FROM `#__chronoforms_data_anagrafica_enti`
WHERE `year` = '$district'
ORDER BY `name`;
";
$db->setQuery($query);
$data = $db->loadObjectList();
if ( count($data) ) {
$m = new stdClass();
$m->id = 0;
$m->SchoolName = 'Select School';
$data = array_merge(array($m), $data);
$return = JHTML::_('select.genericlist', $data, 'name',
'class="inputbox required select" size="1" ', 'id', 'name','city', 0);
} else {
$return = "Sorry, we couldn't find that District";
}
} else {
$return = "Sorry, we couldn't find a district id";
}
echo $return;
$mainframe->close();
?>
$mainframe =& JFactory::getApplication(); $mainframe->close();
and i guess that the part of code that shows requested data in the second drop down is this:
$return = JHTML::_('select.genericlist', $data, 'name',
'class="inputbox required select" size="1" ', 'id', 'name', 0);
I really don't understand how it works cause i don't know anything about ajax...
Could you kindly explain to me how to show data in the drop down list as NAME - CITY and how to make the form consider the cf_created_by correspondent to the NAME - CITY selection?
Thanks in advance...
Federico
Ok... i solved replacing the code i didn't understand with an echo of a drop down...
This topic is locked and no more replies can be posted.