Here is a screenshot -

Thanks,
Matt
CFv6
Joomla 3.8.13
set the options to {var:field_select13}
Do I need to set up an event onchange trigger and run a function?
Sorry, first time attempting this
Matt
$options = [];
switch($this->data('what_do_you_think')){
$options = 'data6.title';
}
return $options;
I know this is not correct but I'm going in circles trying to figure out how this is supposed to be. My first dropdown is pulling the data from {var:read_data7} and it is working as I intended grabbing from 'data6.created_by_alias' and 'data6.introtext' from the database. I'd like to have the second dropdown show the 'data6.title' in 'catid:12' as options based on the 'data6.created_by_alias' selection. I'm hoping I explained that correctly...
thanks,
Matt
I've tried this with a new read data -
$options = [];pretty sure my syntax is messed up tho, can't figure out where I'm going wrong...
switch($this->data('what_do_you_think')){
$options = '{var:read_data8}';
}
return $options;
$options = [];I'll be honest, I'm completely lost on how the syntax is supposed to look. I've been scouring the forum but cannot find a similar situation to emulate.
switch($this->data('what_do_you_think')){
case 'good':
$options = ['1' => '1', '2' => '2', '3' => '3'];
break;
case 'bad':
$options = ['-1' => '-1', '-2' => '-2', '-3' => '-3'];
break;
case 'so':
$options = ['good' => 'Good', 'bad' => 'Bad'];
break;
}
return $options;
I've been modifying the demo code to see if I can get this to work
this is what I currently have -






$options = [];
switch($this->data('what_do_you_think')){
$options = '{var:read_data8.data6.created_by_alias}';
}
return $options;
still not working...
Am I supposed to change the switch statement to something else or remove it?
The switch statement is like saying if $variable is A, do this. If it's B, do this. If it's C etc etc. the way you have it now won't work.
Do you have a custom code block after it with {view:field_identifier}?
$options = [];There is a custom code after it that was already there from the demo
($this->get('what_do_you_think')){
$options = '{var:read_data8.data6.created_by_alias}';
}
return $options;
{view:field_select2}and in the dropdown called "field_select2" I have{var:options}
0=NoneI can see the second dropdown (field_select2) which is only populated with the "None" option and when I select an option from the first dropdown (field_select1) I just get a spinning wheel as if it is searching...
Also your code makes absolutely no sense🙂
You don't even need the PHP in there, now that I've understood more clearly what you're trying to do. Get rid of the PHP block, and in your dropdown field_select2, put
{var:read_data8}
Make sure your read data action is set to "Return an array of key/value pairs"
The picture in my first post explains what I'm trying to do. I want the first dropdown to show the "created_by_alias" field from two categories (this I already have set). After selected, I would like the second dropdown to show everything that matches the first dropdown selection but display the "title" field associated with the first selection in just one of those categories.
I have a store name set as the "created_by_alias" field which falls in multiple categories (this is the first dropdown)
when the store name is selected I want the second dropdown to show the multiple "title" options from category 12 that are associated with the store name
and third dropdown to show category 13
Hope I explained that correctly
On Load: Read data --> Display Dropdown 1
On selecting something from Dropdown 1: Read data based on Dropdown 1 selection--> Display Dropdown 2
On selecting something from Dropdown 2: Read data based on Dropdown 2 selection --> Display radio buttons
Is that right? All you're stuck with is trying to get the right information displayed on the Radio buttons?
same data in a Radio Button later once I figured out the code...
This is what I would like -
On Load: Read data --> Display Dropdown 1 (cat12 & cat13 "created_by_alias")
On selecting something from Dropdown 1: Read data based on Dropdown 1 selection--> Display Radio Buttons 1 (cat12 "title")
On selecting something from Dropdown 1: Read data based on Dropdown 1 selection--> Display Radio Buttons 2 (cat13 "title")
I would like two separate radio buttons based on the initial selection in Dropdown 1
myRadioField1In the "reload event" field of each of those radio fields you'll need separate events, one for the first radio select group and one for the second. Then put in the requisite {var:read_data#} in their options
myRadioField2
I've set the onchange and the reload events as you have suggested but am getting nowhere. I can see the radio group but it stays blank
Here is a frontend view
http://coupons.cuttingcoupons.net/index.php?option=com_chronoforms6&chronoform=dynamic-test
I found a thread here:
https://www.chronoengine.com/forums/posts/t103555/2-dynamic-dropdonw-based-on-db-table.html
seems to do what I need, I'll just have to modify it for my purpose
This is the read data that I used to populate the radio group -

The 1st pulldown (storename) shows the "created_by_alias" field from the DB. You can see below that the store "A Pea in the Pod" is showing up twice. There are two instances where this happens to be the "created_by_alias". I'd like to just show the field once in the pulldown and have the radio group show the multiple "title" fields from a specific "catid" field in the database (catid = 12)

So, the user selects "A Pea in the Pod" from the pulldown and the radio group would show the following "title" fields from "catid"12
Up to 26.65% Off A Pea in the Pod Gift Cards - (Cardcash)
A Pea in the Pod - Get Up To 1.0% Cash Back (Ebates)
Currently it seems to be only showing the one "title" from each selection

The value of each radio group selection is in the "introtext" field of the database which would be 26.65 and 1.0 for the examples shown above
Here is the database -
And try using created_by_alias as your dropdown value and in your where condition, since it looks like you're using "title" which again appears to actually be "Up to 26.5% blahblahblah"
Also I wouldn't use introtext, I'd use the id for the value of the radio group.

"storename" being the ID of my dropdown
"created_by_alias" and "catid:12" the fields in the database
