Gravity-Forms-Multiple-Form-Instances icon indicating copy to clipboard operation
Gravity-Forms-Multiple-Form-Instances copied to clipboard

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

Open elliott-w opened this issue 3 years ago • 1 comments

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.

elliott-w avatar Sep 10 '21 01:09 elliott-w

Thank you very much! Indeed it works very good with conditional logic!

TehKonnos avatar Mar 18 '22 21:03 TehKonnos