I am having this exact same issue. Is there a chance to get this resolved? Fixing it should be trivial, as explained in the post linked above.
Unrelated: are there any plans to move CF7 away from the jQuery dependency?
To fix the error I had to make the change suggested here https://wordpress.org/support/topic/uncaught-typeerror-wpcf7-initform-is-not-a-function/
(moving the jQuery “on ready” function in scripts.js that calls wpcf7.initForm to after the initForm function is defined)
Please @takayukister consider to add this fix, this way who is using ajax loaders (I’m using swup) with CF7 doesn’t have issues, thanks
-
This reply was modified 4 years, 6 months ago by manuel_84.
Hi,
Great plugin! Please @takayukister apply this simple patch. Why declaring the DOMContentLoaded event handler before constructing the wpcf7 object? it broke the plugin if that event was already trigger…please add it to next version
@takayukister any news on that fix? I have stumbled on this error as well
@takayukister any news on that fix? problem is still here. I have to replace scripts.js on every website. My situation is using CF7 + W3 Total Cache and deferring js. Chrome shows error, Firefox not.
Hi, I have the same issue.
I found a simple fix : https://bensinger.me/contact-form-7-fixing-wpcf7-initform-not-function-error/
Could you put it in your next version please ?
Hi, same issue.
https://bensinger.me/contact-form-7-fixing-wpcf7-initform-not-function-error/
Would you be able to include this in a future update please?
same on my site/template. can you fix this?
was this resolved? I am having the same issue and unable to find a solution.
I had the same problem, so I decided to see what console.log(wpcf7)
would give me. And it turned out there is no method initForm. There’s just init. Because of that, please try replacing wpcf7.initForm()
with wpcf7.init()
.
Hope it helps.
I can confirm that @uzartom’s solution works.
If you have a line of code that looks something like this:
wpcf7.initForm($form);
Change it to
wpcf7.init($form[0]);
The init function takes a HTMLElement, while the initForm function expected a jQuery object. Assuming that $form is the jQuery object representing your form (i.e. $('form').eq(0)
), you can access the HTMLElement with $form[0]
A working example can be found here:
https://conditional-fields-cf7.bdwm.be/ajax-example/
-
This reply was modified 2 years, 9 months ago by Jules Colle.