Hello, I'm new to GF and trying to figure out how to work with filters. I have some code that dynamically populates a drop down with only child taxonomies, and when that child is clicked will list all posts under that child taxonomy. The drop down is currently not made through GF, but I would like the drop down to match the look of the drop downs I created using GF so I think my choices are to use a filter to dynamically populate the GF dropdown, or apply the jquery/css to the existing dropdown to match the GF.
I've been looking through the forum and the docs and trying the filter example for dynamically populating a drop down and I can't get it to work.
I've created a basic form (id 3) with just a drop down field. I've checked the "Allow field to be populated dynamically" and added a parameter name of "dyn_test".
In my functions I added your example code:
'add_filter('gform_field_value_dyn_test', 'my_custom_population_function');
function my_custom_population_function($value){
return 'boom!';
}'
When I add the form to a page, it shows "Select an option" but then the drop down is empty. I've also added a single line text box, and it correctly shows "boom!" when the page loads.
Can someone help me understand why it's not populating the drop down correctly? It's currently on a localhost, but I can try it on a live site if needed.
I would like to figure this out, but another option I have is to apply jquery/css to my existing drop down to make it function the same as GF enhanced user interface. If that's easier, is there any documentation that shows how to do this? I've spent quite a bit of time reading through the docs and forum but can't figure it out.
Thank you!