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 14 years ago on Sunday September 19, 2010 |
Permalink