• Hi team,

    I’ve encountered an issue where conditional fields are not being hidden or shown as the user fills out the form. Disabling this plugin makes the conditional statements work again as intended.

    In our particular instance, we only need this plugin for our client’s subscription form, as it appears in the footer as well as in the homepage content. Luckily they’re both set up to use ajax, so I created a quick action to enable or disable the gform_get_form_filter filter depending on whether the form is ajax or not.

    add_action( 'gform_register_init_scripts', function( $form, $field_values, $is_ajax ) {
    	$registered = empty( $GLOBALS['gravity_forms_multiple_form_instances_disabled'] );
    	if ( isset( $GLOBALS['gravity_forms_multiple_form_instances'] ) ) {
    		if ( $registered && ! $is_ajax ) {
    			remove_filter( 'gform_get_form_filter', array( $GLOBALS['gravity_forms_multiple_form_instances'], 'gform_get_form_filter_multiple' ), 10, 2 );
    			$GLOBALS['gravity_forms_multiple_form_instances_disabled'] = true;
    		}
    		if ( ! $registered && $is_ajax ) {
    			add_filter( 'gform_get_form_filter', array( $GLOBALS['gravity_forms_multiple_form_instances'], 'gform_get_form_filter_multiple' ), 10, 2 );
    			$GLOBALS['gravity_forms_multiple_form_instances_disabled'] = false;
    		}
    	}
    }, 10, 3 );
    

    I’m happy for you to use this code as a template where you can create a settings page and allow users to enable this for ajax forms only, but I feel the plugin may need to be adjusted so that conditional statements will continue to function. Alternativey, it may be necessary to create a form setting that can be used to disable this functionality on a form by form basis.

    • This topic was modified 4 years, 9 months ago by shaunjeffrey.
    • This topic was modified 4 years, 9 months ago by shaunjeffrey.
    • This topic was modified 4 years, 9 months ago by shaunjeffrey. Reason: Code formatting
Viewing 3 replies - 1 through 3 (of 3 total)
  • Hello @shaunjeffrey Did you find any solution ?? I face the same problem

    Thread Starter shaunjeffrey

    (@shaunjeffrey)

    Hi @soumyaroyy, I haven’t received any response yet.

    As mentioned for my particular situation, the forms that appeared multiple times were simple forms that didn’t have any conditional statements, so I was able to disable this function easily by removing and/or re-adding the gform_get_form_filter_multiple filter for specific forms.

    Unfortunately, this solution will not work for you if the forms that appear on the page multiple times use conditional statements. If the latest version doesn’t work, you are unable to find a solution and the plugin developer is unable to assist further, then you may need to forego this plugin entirely and just create a duplicate of the forms that you want to use on different parts of the page.

    I also face the same issue. Conditional Logic is not working with this plugin enabled. (not even in the Gravity Form preview mode)

    This needs to be fixed.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Conditional fields not updating’ is closed to new replies.