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.

Dynamically Populating Drop Down Fields with

  1. This post is fantastic - http://www.gravityhelp.com/documentation/page/Dynamically_Populating_Drop_Down_Fields, but I'm wondering if there's a way to group the options in <optgroups>?

    It would be handy to be able to pass an array of arrays. i.e. array['MyHeading']['opt 1', 'opt2', 'opt3'];

    thanks!

    Posted 12 years ago on Friday January 20, 2012 | Permalink
  2. You could. However, to do so would require extending the logic in the function that renders the select boxes, as seen in the file:

    /wp-content/plugins/gravityforms/common.php

    Specifically, the switch case matching "select" in the function:

    public static function get_field_input($field, $value="", $lead_id=0, $form_id=0)

    and possibly the function that renders the <options> tags:

    public static function get_select_choices($field, $value="")

    Posted 12 years ago on Monday February 27, 2012 | Permalink

This topic has been resolved and has been closed to new replies.