Hi!
I created a custom field type and i try to change the defaultValue by using the gform_pre_render, but somehow its not working.
Here is the gform_pre_render function:
add_filter("gform_pre_render", "populate_field");
function populate_field($form){
$postID = $_GET['id'];
if($form["id"] != 5)
return $form;
foreach($form["fields"] as &$field) {
if($field["id"] == 34){
$field["defaultValue"] = 'just a test default value';
}
}
return $form;
}
So as you can see, nothing special, however, its not working. If i set the default value in the admin panel, its working fine, but i can't change it like this. I also tried to change the description, and surprisingly that is working fine.
Any idea? Thanks