When using Contact Form 7 see this
If writing your own raw HTML form, use [cfdb-html] inside your SELECT tag to create the OPTION tags.
Do I have to call the [cfdb-html] with the do_shortcode() function?
PS: By the way, I cannot edit the CF code, as well as functions.php or any other WordPress file. I have to insert PHP code through a plugin.
You can use my Add Shortcodes, Actions and Filters plugin to add code. That is what is used in the first link I gave.
[cfdb-html] : I mean if you plan to add HTML directly into your post to create a form, then you just add the shortcode in the post as well.
Thanks, I got it working. Is there a way to fill fields based on the selected option in the dropdown?
You would have to write Javascript or JQuery to accomplish this. You can create CFDB export links that return JSON to query for values dynamically.
OK. One last question: how can I save CF DB columns on an array for later use?
Like, if I have the column “name” in my CF DB, all of its rows get saved on an array.
I tried to save the contents of row[‘col’] on an array, but it didn’t work.
CFDB doesn’t support an array of values just a string. You might try putting the values as a comma delimited string then parse them out when you access it.
Thank you very much! I got it working.