• Hello,

    I have a problem with a site where I have the Contact Form 7 plugin being used.

    When submitting the form, the page reloads instead of submitting via Ajax.

    I noticed that the /contact-form-7/includes/js/scripts.js script is not loaded.

    I am also using the Async JavaScript plugin.

    I’ve tried several ways to make it load, but only load if the user is logged in.

    I Tried:

    – Include /contact-form-7/includes/js/scripts.js in “Exclude scripts from Autoptimize”;
    – Include /contact-form-7/includes/js/scripts.js in “Script Exclusion” (Async JavaScript);
    – Include plugins / contact-form-7 / in “Exclude scripts from Autoptimize”;
    – Include plugins / contact-form-7 / in “Script Exclusion” (Async JavaScript);
    – Include a direct call with the <script> tag in the theme footer;

    Even so, it is not deleting this script and does not load Ajax correctly.

    The error started appearing after I made the following updates:
    Autoptimize version old 1.15.2 installed. Update to 1.17.1
    Async JavaScript version old 2.18.12.10 installed. Update to 2.19.07.14
    CF7 version old 5.1.3 installed. Update to 5.1.4

    Can you help me with this?

    The page I need help with: [log in to see the link]

Viewing 15 replies - 1 through 15 (of 26 total)
  • Plugin Author Optimizing Matters

    (@optimizingmatters)

    first and foremost try if it works:
    * with AsyncJS disabled and AO enabled?
    * with AO disabled and AsyncJS enabled?
    * with AO enabled but critical CSS and AsyncJS enabled?
    * with both AsyncJS and AO disabled?

    frank

    Thread Starter MarcosAlexandre

    (@marcosalexandre)

    Hi,

    * with AsyncJS disabled and AO enabled?
    Does not work

    * with AO disabled and AsyncJS enabled?
    It works

    * with AO enabled but critical CSS and AsyncJS enabled?
    Does not work (This is the way I need it to work.)

    * with both AsyncJS and AO disabled?
    It works

    Disabling the “Also aggregate inline JS?” it works, but PageSpeed scores down 5 points on mobile and on desktop ;(

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    OK, what JS errors are visible on the browser console on that page with the contact form before and after submitting?

    Thread Starter MarcosAlexandre

    (@marcosalexandre)

    No error is displayed, just note that in sources CF7 script.js file is not loaded
    ;(

    Enable “Also aggregate inline JS?
    https://prnt.sc/pejjfi

    Disable “Also aggregate inline JS?
    https://prnt.sc/pejlcj

    Strangely, in Firefox (the above tests are in Chrome), it also doesn’t load CF7 files (at least not in Debugger), but the form works correctly.
    https://prnt.sc/pejn9o

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    try adding wpcf7 to the comma-separated JS optimization exclusion list. if that does not work can you test with recaptcha disabled to see if that’s the root cause?

    Hi there facing the same issue,
    I have configured Autoptimize and got a page refresh problem with my contact form 7 form.
    Now I have deactivated the Autoptimize but the page refresh problem remains.

    Regards,
    Fenil

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    if the problem remains when AO is not active (and when you have cleared any page cache you might have) then the problem was unlikely due to AO in the first place Fenil?

    The problem caused by enabling the Js part. Till then it was working fine and now the css for validation has also stopped working.
    This is the link you can test…
    https://atira.in/testing-2/

    Also, the CSS for validation stopped working after deleting the Autoptimize plugin. So have to activate the plugin again and have tick the CSS in Autoptimize for the CSS thing working. but the contact form 7 page refresh problem still there…

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    the CSS for validation stopped working after deleting the Autoptimize plugin

    that too is more then likely due to page caching, make sure to clear any page cache you might have.

    Hey, thanks for the reply,
    I have clear the cache from Autoptimize. But seems to be the same problem.

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    no, I was talking about page caching, which AO does not do ??

    So Where will I have to do this? Can you guide me ??

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    Problem is I have no idea what page cache you’re site is using webkow ??

    Current I am not using any page cache plugin

Viewing 15 replies - 1 through 15 (of 26 total)
  • The topic ‘Error with Contact Form 7 (reload page after submit form)’ is closed to new replies.