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.

Add new predefinied choices

  1. fuhrmara
    Member

    Hi !

    I extended the predefinied choices by doing :

    function addLadies($predefinied_choices) {
    
        $predefinied_choices[__("Ladies", "gravityforms")] = array("Heidi", "Jennifer", "Poison");
        return $predefinied_choices;
    
    }
    add_filter("gform_predefined_choices", "addLadies");

    Is this the right way ?

    Posted 14 years ago on Sunday January 10, 2010 | Permalink
  2. Here is the format for adding predefined choices using a hook:

    add_filter("gform_predefined_choices", "add_predefined_choice");
    function add_predefined_choice($choices){
    	$choices["My New Choice"] = array("Choice 1", "Choice 2", "Choice 3"); //Adds a new predefined choice to the end of the list
    	return $choices;
    	}
    Posted 14 years ago on Monday January 11, 2010 | Permalink
  3. webucast
    Member

    How about this? I need to create a form A that would collect a list of Doctors. Then another form B that would collect a list of patients that would offer Doctor's Names from form A as a drop-down. I can't figure out how to do that, and how to offer values of one form in another as a dropdown?

    Posted 13 years ago on Thursday August 19, 2010 | Permalink
  4. bend11235
    Member

    I know this is old but I'd love to do something like this as well. I'd like one form for customer's to fill out their info, and on another form (for my employees), I'd like them to be able to select a customer's name from a dropdown (which will be populated by the customer names entered in the first form).

    Posted 12 years ago on Friday June 3, 2011 | Permalink
  5. Does this go in my themes functions.php file?

    Posted 12 years ago on Wednesday June 15, 2011 | Permalink
  6. Yes you would place this custom code in your themes functions.php file.

    Posted 12 years ago on Wednesday June 15, 2011 | Permalink