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.

Sharing

  1. I'm putting together a list of UK Counties and main towns in those counties.

    Is there a way I can share these with you to be used in the bulk add/predefined section of drop-down menus?

    I figured if I have to do it, there is no need for others to have to do it too.

    Also, is there a way to create bulk choices and save them for future use?

    Posted 13 years ago on Sunday September 19, 2010 | Permalink
  2. Sure, you're welcome to send us a the list and we'll see about adding it or making it available in some fashion. Thanks. You can end it to carl at rocketgenius.com - just reference this thread so he know's what's up.

    Yes, you can add your own choices via a filter. The filter is executed when the form editor is loaded, before creating the list of predefined choices for the selection fields (Checkboxes, Multiple Choice and Drop Down). It can be used to add new predefined choices as well as deleting existing ones

    This would add to all the forms..

    <?php
    add_filter("gform_predefined_choices", "add_predefined_choice");
    ?>

    or this for a specific form. In this case, form Id 5

    <?php
    add_filter("gform_predefined_choices_5", "add_predefined_choice");
    ?>

    then you would add your choices.. in an array

    $choices["My Favorite Food"] = array("Fruit", "Hamburger", "Beans");

    so this example would add a new list of choices to the end of the list.

    <?php
    add_filter("gform_predefined_choices", "add_predefined_choice");
    function add_predefined_choice($choices){
       $choices["My New Choice"] = array("Choice 1", "Choice 2", "Choice 3");
       return $choices;
    }
    ?>

    Hope that helps.

    Posted 13 years ago on Sunday September 19, 2010 | Permalink
  3. Thanks, I'll pass that on once I have it.

    Posted 13 years ago on Sunday September 19, 2010 | Permalink
  4. Is that added to the functions.php file?

    Edit: It's ok, I've seen that it is

    Posted 13 years ago on Sunday September 19, 2010 | Permalink