Hello,
I am pre rending a product field. The product field is a radio type and it is required.
But even though my pre rendering works, and I selected one, I still get the 'This field is required.'
See screenshot: i.imgur.com/znMkAiA.png
This is my pre render code. It works fine.
add_filter("gform_pre_render", "product_items");
// add_filter("gform_admin_pre_render", "product_items");
function product_items($form){
if($form["id"] != 2) return $form;
$products = get_field('item_information',$post->ID);
$items = array();
foreach($products as $product)
$items[] = array( "text" => $product['order_description'].' <em class="muted">€'.$product['price_euro'].'</em>', "value" => $product['price_euro'] );
foreach($form["fields"] as &$field){
if($field["id"] == 1 ){
$field["choices"] = $items;
$field["label"] = get_the_title($post->ID);
}
}
return $form;
}
I dont understand why it wont pass the validation even when it is selected?
Any help into understanding why I am having validation issues would be great thanks.