• Resolved Asif

    (@asif_rn)


    I set up and tested a form without any problem but the moment I changed the default theme it stopped working and started showing this message:

    “Heads up! WPForms has detected an issue with JavaScript on this page. JavaScript is required for this form to work properly, so this form may not work as expected. See our troubleshooting guide to learn more or contact support.”

    When I go back to WordPress Twenty Twenty-Three default theme it starts working again. My theme is not using any magnification or cache plugin at the moment as it is a work in progress. I started to debug by disabling every JS file and script and found what was causing the problem. Since I’m not using WordPress supplied jquery therefore I disabled it in functions.php:
    wp_deregister_script( ‘jquery-core’ );

    Though I’m still using a jquery file from a CDN but the script above breaks the WPForms plugin and makes it show the message above. Any idea how to fix this as I need to finalize this plugin?

    • This topic was modified 1 year, 4 months ago by Asif.
Viewing 11 replies - 1 through 11 (of 11 total)
  • Plugin Support Ralden Souza

    (@rsouzaam)

    Hi @asif_rn,

    Thanks for reaching out!

    Considering this: “When I go back to WordPress Twenty Twenty-Three default theme it starts working again”. It looks like there might be a conflict between the forms and your theme.

    If I correctly understood, you added wp_deregister_script( 'jquery-core' ); in functions.php. Please know that some form functionalities rely on jQuery, and this is the reason that the form is breaking on your theme.

    So, you could start removing that script from your theme, and verifying if the issue continues.

    In case the issue continues, as indicated in our guide on how to test for plugin/theme conflicts, you could contact the theme’s author / support team, and let them know about the issue you’re facing. In many cases, the support team or author will be familiar with the problem already, and may even have a solution to share with you.

    Hope this helps!

    Thread Starter Asif

    (@asif_rn)

    Hi Ralden,
    While I’m removing WordPress default jQuery I’m loading another one from https://cdn.jsdelivr.net/npm/jquery@3.7.0/dist/jquery.min.js
    If WPForms need jQuery then it is still included but not the default one. Is there a way we can use the CDN version than the default one?

    Plugin Support Ralden Souza

    (@rsouzaam)

    Hi @asif_rn,

    You should be able to use a CDN. However, in case our assets load before jQuery, this will generate an error.

    That said, please verify if your CDN uses defer or there is a setting to defer jQuery on your site. If yes, you’d need to exclude jQuery from defer or disable defer functionality to solve the issue.

    Hope this helps!

    Thread Starter Asif

    (@asif_rn)

    The jQuery is simply loaded in functions.php:
    wp_enqueue_script(‘aksgar-jquery’, ‘https://cdn.jsdelivr.net/npm/jquery@3.7.0/dist/jquery.min.js’, array(), ”);

    The deferred jquery URL is something like this:
    https://cdn.jsdelivr.net/npm/jquery-deferred@0.3.1/index.min.js

    So it doesn’t seem to be deferred. Also, due to some jQuery functionalities I need to load jQuery in the head so it is certainly coming before the wordpress default jquery that is loaded in the footer.

    Thread Starter Asif

    (@asif_rn)

    After playing around with the default jQuery placement order, that part is sorted but now it is “Please enable JavaScript in your browser to complete this form.”
    JavaScript is already enabled though. Check the DevTools console and there are tons of message:

    Error with Permissions-Policy header: Origin trial controlled feature not enabled: ‘interest-cohort’.
    Error with Permissions-Policy header: Origin trial controlled feature not enabled: ‘interest-cohort’.

    Request for the Private Access Token challenge.
    VM10432:3 The next request for the Private Access Token challenge may return a 401 and show a warning in console.
    VM10432:3 GET https://challenges.cloudflare.com/cdn-cgi/challenge-platform/h/g/pat/7d294ed8add16ba4/168…

    Even if I disable Cloudflare Turnstile, I still “Please enable JavaScript in your browser to complete this form.”

    • This reply was modified 1 year, 4 months ago by Asif.
    Plugin Support Ralden Souza

    (@rsouzaam)

    Hi @asif_rn,

    As WPForms worked when you changed to the Twenty Twenty-Three theme, it looks like the issue might be related to the theme. I apologize as theme adjustments are outside of our scope for support.

    To fix the issue, you could contact the theme’s author / support team, and let them know about all the issues you’re facing. In many cases, the support team or author will be familiar with the problem already, and may even have a solution to share with you.

    Hope this helps!

    Plugin Support Ralden Souza

    (@rsouzaam)

    Hi @asif_rn,

    We haven’t heard back from you in about a few days, so I’m going to go ahead and close this thread for now. But if you’d like us to assist further, please feel welcome to continue the conversation.

    Thanks!

    Plugin Support Pranali Patel

    (@pranalipatel)

    Hi @asif_rn ,

    I have re-opened this thread to help you further on this. We would need some more details to troubleshoot the issue further.

    I see you mentioned that you are using the jQuery file via CDN. To understand better, can you please share why you are using CDN for this?
    Is it a customised version of the jQuery? If it is customised version, can you please check and confirm if the issue persists if you remove the customised code?

    This information will help us assist you further and fix any issue at our end.

    We are looking forward to hearing back from you.
    Thank you!

    Thread Starter Asif

    (@asif_rn)

    Hi, I was using jquery from the CDN because the wordpress default was outdated.

    I switched back to the wordpress default for some other reason but the “Please enable JavaScript in your browser to complete this form.” never disappeared. I tried several other forms and no other form thrown this error as there was none. After several weeks I gave up on this plugin and now using Ninja Form without any issue. It never once shown this message “Please enable JavaScript in your browser to complete this form.”

    Plugin Support Kenneth Macharia

    (@kmacharia)

    Hi @asif_rn,

    Kenneth here, jumping in to help with the investigation. I’m sorry for the frustration caused by the jQuery error. I suspect that due to a timing issue, the CDN jQuery script was getting loaded after the form has already been loaded. If you don’t mind, would you mind sharing the complete snippet that your were using? I would be happy to chase this down further and pass my findings with the development team so that we can improve how this is handled internally.

    Thanks!

    Plugin Support Kenneth Macharia

    (@kmacharia)

    Hey @asif_rn

    We haven’t heard back from you since my previous message, so I’m going to go ahead and close this thread for now. But in case you get a moment to share the code snippet, please feel welcome to continue the conversation.

    Thanks!

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘WPForms has detected an issue with JavaScript – Not minification related’ is closed to new replies.