Pre-populate a select drop down using PHP function [RESOLVED]

Continuing the discussion from Prepopulating a select field on a form embedded by function call:

I am running into this issue as well. You’d say it’s possible to pre-populate a dropdown with the gravity_form()-function, since the dropdown has the option te be pre-populated. But documentation is missing.

You can’t pre-populate a drop down field using the gravity_form() function, using this you can only pre-select existing choices of your drop down.

If you want to pre-populate the drop down you need to use a different approach:

  1. First ensure that your field is already configured to accept dynamic population: Dynamically Populating a Field - Gravity Forms Documentation

  2. The following tutorial describes a full working example: Dynamically Populating Drop Down, Radio Buttons or Multi-Select Fields - Gravity Forms

Here’s another example: gform_pre_render - Gravity Forms Documentation

2 Likes

Yeah, I’m sorry. I totally messed things up in my head and already found out (again) that I needed to use a filter. :sweat_smile: