Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #1438400

    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

    #1438427

    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

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.