Hi team,
Could you please confirm if there is a way to incorporate a conditional field within Enfold’s built-in contact form? Is this feasible?
Thank you
Hey Rens18,
Thank you for the inquiry.
There is no default option for this, but you can use the avia_contact_form_elements filter to modify the contact form fields before they are rendered. For example, the code below will loop through the $form_fields and remove or unset the field with the key “name”. You can add your own conditions as you like.
add_filter('avia_contact_form_elements', function($form_fields) {
foreach ($form_fields as $key => $value) {
if($key == 'name') // add conditions here
{
unset($form_fields[$key]);
}
}
return $form_fields;
}, 10, 1);
Best regards,
Ismael