I have successfully populated a drop-down field from a Dynamic Data DB Read using the instructions you provided here:
http://www.chronoengine.com/faqs/58-cfv4/cfv4-elements-and-html/2647-how-do-i-build-a-select-drop-down-radio-button-or-checkbox-group.html
I am currently pulling the item ID and title from a K2 items table. It works. However it's displaying all the items.
What snippet of code do I need to create a condition whereby only published K2 items are read in? (published field = 1)
I would also like the conditional code to only pull from a specified category. I have 6 categories (2 main categories with ID's 1,4 and 4 sub-categories with ID's 2,3,5,6). I would like the DB Read to pull only from category ID #1.
FYI, I tried the code < ?php return array('field' => 'value'); ?> populated with 'field' replaced by 'published' and 'value' replaced by '1' but it returned as a text string at the top of the form.
I also set Multi read to 'yes' in the Edit Action Settings.
Thank you,
Shannon
http://www.chronoengine.com/faqs/58-cfv4/cfv4-elements-and-html/2647-how-do-i-build-a-select-drop-down-radio-button-or-checkbox-group.html
I am currently pulling the item ID and title from a K2 items table. It works. However it's displaying all the items.
What snippet of code do I need to create a condition whereby only published K2 items are read in? (published field = 1)
I would also like the conditional code to only pull from a specified category. I have 6 categories (2 main categories with ID's 1,4 and 4 sub-categories with ID's 2,3,5,6). I would like the DB Read to pull only from category ID #1.
FYI, I tried the code < ?php return array('field' => 'value'); ?> populated with 'field' replaced by 'published' and 'value' replaced by '1' but it returned as a text string at the top of the form.
I also set Multi read to 'yes' in the Edit Action Settings.
Thank you,
Shannon
Hello shamrick,
I'm not a Chrono professional, but after checking your new post, I think that the following links may help:
How to load record data from a database table into your form
P.S: I'm just an automated service😉
I'm not a Chrono professional, but after checking your new post, I think that the following links may help:
How to load record data from a database table into your form
P.S: I'm just an automated service😉
Hi Shannon,
You should use this code in the "Conditions" box:
Regards,
Max
You should use this code in the "Conditions" box:
<?php
return array("published" => 1);
Regards,
Max
Max,
Thank you.
May I follow up with an additional question? How may I pass the text string title that's chosen into the email? It currently shows what looks like the ID #.
Thank you.
May I follow up with an additional question? How may I pass the text string title that's chosen into the email? It currently shows what looks like the ID #.
Hi Shannon,
Use a DB Read in the On Submit event to look up the title from the ID; or, if the titles are unique you could possibly use them in the drop-down instead of the id so the options would have both the value and text holding the titles,
Bob
Use a DB Read in the On Submit event to look up the title from the ID; or, if the titles are unique you could possibly use them in the drop-down instead of the id so the options would have both the value and text holding the titles,
Bob
Bob,
Thank you for that. Unless I'm misunderstanding something, I do see the titles and not the ID's in the drop down box.
When the email is submitted, the ID shows as the value instead of the title itself.
Wondering if I needed a bit of php code in the email to pull the title? Or should I use another DB Read in the On Submit as you suggested?
Thanks.
Thank you for that. Unless I'm misunderstanding something, I do see the titles and not the ID's in the drop down box.
When the email is submitted, the ID shows as the value instead of the title itself.
Wondering if I needed a bit of php code in the email to pull the title? Or should I use another DB Read in the On Submit as you suggested?
Thanks.
Hi Shannon,
A drop-down has two parts to the data: the text - which you can see; and the value which is submitted but you can't see. Look at the page source to see them both.
Bob
A drop-down has two parts to the data: the text - which you can see; and the value which is submitted but you can't see. Look at the page source to see them both.
Bob
Hi Shannon,
In this case you should enter "title" in both the "text" and "value" boxes under the "Dynamic data" tab in the dropdown settings!
Regards,
Max
In this case you should enter "title" in both the "text" and "value" boxes under the "Dynamic data" tab in the dropdown settings!
Regards,
Max
This topic is locked and no more replies can be posted.
