Just getting started with Chronoforms V4. Worked through the tutorial http://chronoengine.com/downloads/chronoforms/chronoforms-tutorials/154-v4-tutorials.html. Now have a first question.
I want to make a drop selection list in a new form that automatically updates with the a string of several fields from existing mySQL table already created by Chronoforms.
The effect I'm after is
{title} {first_name} {last_name} {year of birth} {year of birth} if dead yet The list will be quite long so alphabetical order will be best.
Thanks in advance
I want to make a drop selection list in a new form that automatically updates with the a string of several fields from existing mySQL table already created by Chronoforms.
The effect I'm after is
{title} {first_name} {last_name} {year of birth} {year of birth} if dead yet The list will be quite long so alphabetical order will be best.
Thanks in advance
Hi njrpartnership,
There are two ways to do this, either will work OK.
You can let ChronoForms get the data for you and then concatenate (join together) the values into a string before creating the option. Or you can hand-code the MySQL query and concatentae the values in the query.
I'd probably do the second one of these in a Custom Code element:
Bob
There are two ways to do this, either will work OK.
You can let ChronoForms get the data for you and then concatenate (join together) the values into a string before creating the option. Or you can hand-code the MySQL query and concatentae the values in the query.
I'd probably do the second one of these in a Custom Code element:
<?php
$db =& JFactory::getDBO();
$query = "
SELECT `id`, CONCAT(`title`, ' ', `first_name`, ' ', `last_name`, ' ', `year_of_birth`, ' ', IF(`year_of_death`, `year_of_death`, '')) AS value
FROM `#__some_table`
WHERE `some_column` = 'some_value'
ORDER BY `last_name` ASC ;
";
$db->setQuery($query);
$data = $db->loadObjectList();
. . . // add code here to build drop-down
Bob
This topic is locked and no more replies can be posted.