Plugin Author
Erik
(@codekraft)
ciao @wendihihihi,
Looks like the CF7-Antispam script isn’t enabled or isn’t working correctly… can you check the developer tools js console in order to check if there are some message related to that?
Hi Erik. I got this message.
index.js:1 wpcf7 is not defined.
(anonymous) @ index.js:1
It doesn’t go away after refreshing the cache. Any thoughts?
Hi Erik, I came across this old code in a post you made two years ago:
[file fileuploader filetypes:jpg id:uploader] <img id=”preview” src=”#” /> <script> var uploader = document.getElementById(‘uploader’); uploader.addEventListener(‘change’, (event) => { var binaryData = []; binaryData.push(document.getElementById(‘uploader’).files); if (binaryData) preview.src = window.URL.createObjectURL(binaryData[0][0]); }); </script>
It’s about image upload preview before submission. Would it be possible to implement this inside a WPForm? I know you created something similar for Contact Form 7, but I’m interested in doing it with WPForm.
Any help would be appreciated!”
Plugin Author
Erik
(@codekraft)
@wendihihihi, that is very strange since the wpcf7 window object should be always available (if you have cf7 plugin active and enabled obviously).
Looks like something related to contact form 7 or even to WordPress… let’s make some tests:
in the devTools console can you type?
wpcf7.api.namespace
the return value is: contact-form-7/v1
?
can you reach the wordpress rest api?
https://mywebsite/wp-json/wp/v2/
👆replace mywebsite with the website url which has the issue.
disabling the plugin solve the issue?
have you tried to google “WordPress: Contact Form 7 Fallback Json Problem” and see if that one is the reason?
@lcastilloh – please if you need some kind of help please open a new issue in the related forum and cite me using the @ . this is not the place, and sincerely never used wpforms, I don’t have a good opinion of it but if I can help you I will gladly do so.
-
This reply was modified 11 months, 1 week ago by
Erik.
Thanks for the suggestions, Erik, found the problem.
In my functions.php I used
//use contact form 7 scripts and styles only on the contact page
add_filter( ‘wpcf7_load_js’, ‘__return_false’ );
add_filter( ‘wpcf7_load_css’, ‘__return_false’ );
I think after the last CF7 update, you cannot use it anymore.
Plugin Author
Erik
(@codekraft)
Looks like related to that, https://github.com/rocklobster-in/contact-form-7/issues/1417 or something similar…
In the next version i should conditionally load the scripts so, since I will also check for the existence of window.wpcf in global object, I don’t think this problem will occur any more.
in any case thanks for the report! 🚀