Hi,
I'm trying to create submission form with ChronoForms where I will have field for users to be able select existing records from Cobalt.
I was looking at render article list documentation but nothing was successfull. CjronoForm uses Autocompleter where you must enter your code.
They have this example:
<?php
$countries = array("Afghanistan", "Albania", "Algeria", "American Samoa");
foreach($countries as $country){
if(!empty($form->data['tag']) AND stripos($country, $form->data['tag']) === false){
continue;
}
$json[] = array('id' => $country, 'text' => $country);
}
echo json_encode($json);
I tried to do the same for records but something like this...:
<?php
$db = JFactory::getDbo();
$query = $db->getQuery(true);
$query = 'SELECT title FROM #__js_res_record WHERE type_id=1 AND published=1';
$db->setQuery($query);
$record_title = $db->loadObjectList();
foreach($record_title as $title){
if(!empty($form->data['title']) AND stripos($title, $form->data['title']) === false){
continue;
}
$json[] = array('id' => $title, 'text' => $title);
}
echo json_encode($json);
?>
...but without success. I'm I missing something.
Hi,
I'm trying to create submission form with ChronoForms where I will have field for users to be able select existing records from Cobalt.
I was looking at render article list documentation but nothing was successfull. CjronoForm uses Autocompleter where you must enter your code.
They have this example:
I tried to do the same for records but something like this...:
...but without success. I'm I missing something.