Skip to content

Forms with conditional logic broken since GF 2.5.3 (fix included) #42

@elliott-w

Description

@elliott-w

Since Gravity Forms 2.5.3, they made it so that form scripts are printed in the footer rather than in the form itself. This made it so that this plugin couldn't modify the form ids in the $form_string and thus broke the plugin. The fix is to make sure scripts always get printed inside the form itself:

add_filter('gform_init_scripts_footer', 'print_scripts_in_form');
function print_scripts_in_form($bool) {
  return false;
}

You can add that code snippet inside the __construct() function of the gf-multiple-form-instances.php file or inside your theme's functions.php file.

Also I'm not sure when the quotes were changed, but you should also change the line:
"id='field_" . $form['id'] . '_' => "id='field_" . $random_id . '_',
with:
'id="field_' . $form["id"] . "_" => 'id="field_' . $random_id . "_",

Also it seems the Google Recaptcha v3 add-on doesn't work for multiple instances of the same form on a single page. I would recommend disabling recaptcha specifically for those forms.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions