Hide Section On Conversational Form

Hi,

How can I hide a Section from displaying on a conversational form? I use the form as a standard form and also a conversational from so I don’t want to disable it completely. But on the conversational form it comes up as a separate question but all it does is show the title of the section and a person has to click continue. So I would like to hide it on the conversational from only. I tried conditional logic but it does not work. Any help would be great.

The following snippet should accomplish this:

// Remove sections from conversational forms
add_filter( 'gform_pre_render', function( $form ) {

    if ( is_conversational_form( $form ) ) {
        $form['fields'] = array_filter( $form['fields'], function( $field ) {
            return $field->type !== 'section';
        } );
    }

    return $form;

} );
1 Like

Thank you for your reply. I will give it a shot.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.