PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

Problem with gform_field_value and Drop Down field

  1. Using this filter is not working with Drop Down or Radio fields. I have set field to be populated dynamically gave it parameter name: products, and tried using this code:

    add_filter('gform_field_value_products', 'populate_products');
    function populate_products($values) {
      return array('Value 1', 'Value 2');
    }

    Field still shows what ever is set for values in form designer. I tried removing all values from designer, but one value always remains.

    Milan

    Posted 12 years ago on Tuesday November 20, 2012 | Permalink
  2. David Peralty

    If you want to populate a dropd own, you'll need to use the following:
    http://www.gravityhelp.com/documentation/page/Gform_column_input

    And for radio buttons:
    http://www.gravityhelp.com/documentation/page/Gform_field_choices

    There currently isn't a single hook that allows you to modify all of the different field types easily. You could do everything through gform_pre_render, but it would potentially take a bit more code.

    Posted 12 years ago on Tuesday November 20, 2012 | Permalink
  3. Thanks. I already did this with pre_render hook.

    Posted 12 years ago on Tuesday November 20, 2012 | Permalink
  4. Milan, is this working for you now, or do you still need help?

    Posted 12 years ago on Wednesday November 21, 2012 | Permalink