wqwi853
Member
The desired behavior I'm looking for is when you select an option in a dropdown on a form that it will auto fill a field in the form from a different list/table.
I have a dropdown element that is using php eval to populate data from a different table from a completely different list. It works as intended.
I want to also grab a different field from that same table that populates the dropdown and autofill one text field in the new form.
For instance. I have a dropdown that concats names from a name table/
"$db = JFactory::getDbo();
$db->setQuery("SELECT id, CONCAT(last_name, ', ', first_name, ' ', middle_initial) AS fullname FROM names");
$rows = $db->loadObjectList();
foreach ($rows as $row) {
$options[] = JHTML::_("select.option", $row->fullname);
}
return $options;"
I also have an ID field in the names table that needs to be autofilled into my new form that uses a new list.
So when someone selects a name from the dropdown, it will autofill the ID into the form when someone is adding a new entry.
What would be the best way to accomplish this in Fabrik?
I have a dropdown element that is using php eval to populate data from a different table from a completely different list. It works as intended.
I want to also grab a different field from that same table that populates the dropdown and autofill one text field in the new form.
For instance. I have a dropdown that concats names from a name table/
"$db = JFactory::getDbo();
$db->setQuery("SELECT id, CONCAT(last_name, ', ', first_name, ' ', middle_initial) AS fullname FROM names");
$rows = $db->loadObjectList();
foreach ($rows as $row) {
$options[] = JHTML::_("select.option", $row->fullname);
}
return $options;"
I also have an ID field in the names table that needs to be autofilled into my new form that uses a new list.
So when someone selects a name from the dropdown, it will autofill the ID into the form when someone is adding a new entry.
What would be the best way to accomplish this in Fabrik?