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.

gform_field_value populate checkboxes

  1. I am trying to use the gform_field_value filter to populate some checkboxes. I have successfully populated single fields, but it doesn't seem to like an array. I get a foreach error. This is what I've tried.

    add_filter("gform_field_value_payment_options", "populate_payment_options");
    function populate_payment_options($value){
    	 	$populate_payment[] = $pay_paypal;
    		$populate_payment[] = $pay_web;
    			return $populate_payment;
    	}

    Any ideas?

    Posted 12 years ago on Thursday October 11, 2012 | Permalink
  2. Where are $pay_paypal and $pay_web defined?

    In the documentation for an array, http://www.gravityhelp.com/documentation/page/Gform_field_value_$parameter_name it looks like this would work, instead of what you have:

    [php]
    add_filter("gform_field_value_payment_options", "populate_payment_options");
    function populate_payment_options($value){
    	return array($pay_paypal, $pay_web);
    }

    However, I am still unsure where you are setting $pay_paypal and $pay_web.

    Posted 12 years ago on Sunday October 14, 2012 | Permalink