Support » Plugins » Gravity Forms – Dynamically populate drop down menu… WITH CUSTOM FIELDS!

  • Hi,

    Not getting the best of support from Gravity Forms. I have a dropdown menu in my form.

    I want to populate this drop down with text from a custom field in a custom post type. Using this code. I am able to populate the menu with the posts’ titles. But how do I modify my code so that it displays the values from my custom field instead of the title?

    Gravity Forms support just told me I’m going to have to customise the code snippet. Instead of get_posts, I will need to use a WordPress function to get all my custom field names. But that’s as far as the support has gone so far.

    I’ve used get_post_meta($post_id, ‘custom_field_name’, false) like so:

    (I’ve replaced ‘custom_field_name’ with the actual field name obviously)

    But it just returns a drop down menu with blank choices repeated. There appear to be 8 blank choices which is the number of posts I’m calling within that category. So something is right, but I’m really not great with php. Can anyone tell me where I’m going wrong?

    Any advice, tutorials… anything, this has stunted me for days.

Viewing 2 replies - 1 through 2 (of 2 total)
  • I know it’s been a while, but I’m wondering if you ever found a solution to this, or maybe even a tutorial or two for the dynamic dropdown population problem.

    I’m trying to write something that will allow for four drop-downs (year, make, model, trim level) so that you are only presented with the ‘models’ available based on your ‘make’ selection, etc etc.

    Any lucky finding any info on how to easily integrate this with Gravity Forms?



    Forum Moderator

    If you require assistance then, as per the Forum Welcome, please post your own topic instead of tagging onto someone else’s topic.

    I am now closing this 6 month old topic as it references an older version of WordPress.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Gravity Forms – Dynamically populate drop down menu… WITH CUSTOM FIELDS!’ is closed to new replies.