Hi.
I would like to be able change some fields as required and not required based on specific pages and I am able to change the isRequired state, but it doesn't affect the form validation.
Here is the code I used:
add_filter("gform_pre_render", "set_required");
function set_required($form){
foreach($form["fields"] as &$field) {
$field["isRequired"] = false;
}
return $form;
}
So I have a couple of fields set to be required in the form editor.
How come the form is validating these fields when I have set all fields to be not required?
Cordially
Vayu