• Resolved Jasper

    (@lucydog)


    Unfortunately, Gravity Forms requires that the JS is loaded in the header, so checking the box next to: “Load JavaScript early, reducing the chance of JS-errors but making it render blocking” causes some forms to now show up.

    The speed of the site was better when I had the box unchecked, so I tried to exclude GF from JS optimization, hoping that the rest of the site would still benefit. Somehow the rules I put in there were incorrect.

    Here is the entire rule. If you can tell what is wrong, I would appreciate it.

    s_sid,smowtion_size,sc_project,WAU_,wau_add,comment-form-quicktags,edToolbar,ch_client,seal.js,/wp-google-search/assets/js/google_cse_v2.js,/gravityforms/js/conditional_logic.min.js,/gravityforms/js/jquery.maskedinput.min.js

    Thank you,

Viewing 10 replies - 1 through 10 (of 10 total)
  • Plugin Author Frank Goossens

    (@futtta)

    well, what JS errors do you see on the browser console when JS is not forced in head and with those exceptions?

    Thread Starter Jasper

    (@lucydog)

    Thanks for the quick response. You get:

    Uncaught ReferenceError: gform is not defined
    at conditional_logic.min.js:1
    (anonymous) @ conditional_logic.min.js:1
    jquery.maskedinput.min.js:7 Uncaught ReferenceError: jQuery is not defined
    at jquery.maskedinput.min.js:7
    at jquery.maskedinput.min.js:7
    (anonymous) @ jquery.maskedinput.min.js:7
    (anonymous) @ jquery.maskedinput.min.js:7
    (index):227 Uncaught ReferenceError: jQuery is not defined
    at (index):227
    (anonymous) @ (index):227
    (index):227 Uncaught ReferenceError: jQuery is not defined
    at (index):227
    (anonymous) @ (index):227
    (index):234 Uncaught ReferenceError: renderRecaptcha is not defined
    at (index):234

    Plugin Author Frank Goossens

    (@futtta)

    ok, one thing you’ll most certainly need to exclude as well is jquery (the wordpress core version can be excluded with js/jquery/jquery.js). can you do that and report back?

    Thread Starter Jasper

    (@lucydog)

    When I do that, the problem of the form not showing up with the “force JS in head” box unchecked.

    I have suspected that the problem is with the conditional logic, because this form has it, and forms that do not have conditional logic were working fine.

    Instead of a long list of errors I still have one error which makes me worried:

    Uncaught ReferenceError: gform is not defined
    at conditional_logic.min.js:1

    Here is the full line of exclusions:
    s_sid,smowtion_size,sc_project,WAU_,wau_add,comment-form-quicktags,edToolbar,ch_client,seal.js,/wp-google-search/assets/js/google_cse_v2.js,/gravityforms/js/conditional_logic.min.js,/gravityforms/js/jquery.maskedinput.min.js,js/jquery/jquery.js

    By the way, I think you figured this out but my first message was confusing. GF requres the “force JS in head” box TO be checked, and we would prefer not to check it as the site is faster with it unchecked.

    Thanks again!

    Plugin Author Frank Goossens

    (@futtta)

    ok, try excluding /gravityforms/js/ instead of /gravityforms/js/conditional_logic.min.js,/gravityforms/js/jquery.maskedinput.min.js?

    Thread Starter Jasper

    (@lucydog)

    That worked perfectly. The form shows up with no errors. Thanks!

    Plugin Author Frank Goossens

    (@futtta)

    great! ??

    have a nice weekend!
    frank

    Hi Frank,

    I’m having a similar issue as above. Autotomize is causing my gravity form not to display.

    My form is using conditional logic and here is the error on the page:

    Uncaught ReferenceError: jQuery is not defined

    Gravity Form support are saying that error is being caused by jQuery being loaded in a combined minified file at the end of the page, when jQuery should be included in the page header.

    They can’t help me resolve the problem and recommended I reach out to you.

    I can’t amend code myself, could you please help.

    Many thanks,

    Kacem

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    as per the FAQ; make sure jquery is excluded from optimization (by default it is in js/jquery/jquery.js).

    Hi Frank,
    Thank you for pointing that out. I ticked the box “Force JavaScript in <head>?” and refreshed the website.

    The form now loads fine but Google Insight’s speed score is complaining.

    Guess you can’t make everyone happy.

    Thanks a lot for your speedy response, much appreciated.

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Gravity forms conflict’ is closed to new replies.