Hi All,
I have created a new form that is quite extensive and am using a few hooks to get taxonomy terms to list as checkboxes. My site is a directory and this form is to function as registration of new sites/companies to be listed. Since my general contact form works flawlessly there has to be another issue with my new form. Here is the link to the registration form: http://directory-sexy.com/lingerie-directory-registration/ and my gen contact form is here: http://directory-sexy.com/contact/
I can only think of two things causing the problem(but could be totally wrong here):
1. My code for adding in the taxonomy terms is causing an issue,
2. My server does not allow that much data to be posted - its a large form.
Here's a sample of my hook function:
add_filter("gform_pre_render_25", populate_lingerie_category_checkbox);
//categories
//form id 25 field id 31
function populate_lingerie_category_checkbox($form){
//get all the lingerie-categories
$terms = get_terms('lingerie-categories', 'orderby=name&hide_empty=false');
//Creating choices and inputs as empty arrays
$choices = array();
$inputs = array();
$i = 1;
foreach( $terms as $term ):
$field_id = "31.".$i;
array_push($choices, array("text" => $term->name, "value" => $term->name));
array_push($inputs, array("label" => $term->name, "id" => $field_id));
$i++;
endforeach;
// we need a counter to create the field id
//Adding items to field id 31
foreach($form["fields"] as &$field):
if($field["id"] == 31):
$field["type"] = 'checkbox';
$field["choices"] = $choices;
$field["inputs"] = $inputs;
endif;
endforeach;
return $form;
}//end populate_lingerie_category_checkbox
With this I am changing a text input into a set of checkboxes. Not sure if this is the correct way to go about it. I do this for all of the taxonomies with separate functions for each text field to change/alter.
I get no notice and no email is sent. I really am at a loss here. Any help is greatly appreciated!