This is kinda a continuation / spin off from a previous thread found here: http://www.gravityhelp.com/forums/topic/problem-using-values-from-dynamically-populated-drop-down-fields
I've got a drop down field that is dynamically populated with a post type using the "populate with post type" option from the advanced menu, but by using this I can no longer preselect an option.
Specifically I'm trying to populate it with a users existing choice so here's the code:
This pulls the existing entry from the database field it's stored in and passes it as the parameter for selection. I know this is treated as the value of the item and the "populate with post type" option sets the post title as both the label and value and the above method works perfectly if the options have been manually added in the editor, they just don't work with the dynamically populated fields.
I'm guessing this is due to the order in which these hooks are rendered so I'm going to try the pre_render hook and see if it helps. I know it's a bit in depth but it's fully within the scope of Gravity Forms so perhaps this could be added into the documentation, which hasn't been updated for a while as it doesn't even cover the new advanced options for the drop down fields.
If this is a bug I'd like to report it but I'd like to run it past the forums first.
Many thanks.