-
-
Save eriteric/5d6ca5969a662339c4b3 to your computer and use it in GitHub Desktop.
This is nuts we have to do this, thank you both!
Works great thank you!
Not all hero's wear capes. Thank you! I agree it's nuts that we have to do this tho...
Thanks for this...for some reason its not wrapping my inline script (for AJAX mode) in the added JS.
EDIT: I got it to work. Bad copy/paste/edit when using within my class. Thanks for this!!!
@consciousimages This is nuts that we still have to do this. Wasted so much time.
Thanks! Saved the day :)
Thanks ❤️
Thanks @JoryHogeveen! Worked a treat.
@noriods
No problem, I forgot I posted this here. Just updated the code to be even more compatible with other parts of WordPress and AJAX.
Nice additions, thanks :)
thank you for saving me hours of work!
Thank you!
Thank you. Works a treat!
Please tell me where to add those snippets?
I added those snippets (one at a time; as they are doing same thing) but on both cases when i defer my javascript on my server, the form doesn't load with an error in console says that jquery is not a function.
Can you please help?
@shireefkhatab
My guess is that something in your installation is preventing jQuery from being loaded at all.
In any case, the snipping needs to be placed (as a whole) in your theme functions.php or in a custom plugin. It would also work as a must-use plugin.
Thanks @JoryHogeveen for your contributions.
Hey guys, this not works anymore with GF 2.5, also from GF 2.5 scripts are by default in footer.
This breaks for me when using conditional logic
Uncaught ReferenceError: gf_global is not defined
Error is thrown from this line:
gf_global["number_formats"][5] = {"1":{"price":false,"value":false},"2":{"price":false,"value":false},"3":{"price":false,"value":false},"4":{"price":false,"value":false},"13":{"price":false,"value":false},"12":{"price":false,"value":false},"6":{"price":false,"value":false},"7":{"price":false,"value":false},"8":{"price":false,"value":false},"10":{"price":false,"value":false}};if(window['jQuery']){if(!window['gf_form_conditional_logic'])window['gf_form_conditional_logic'] = new Array();window['gf_form_conditional_logic'][5] = { logic: { 10: {"field":{"actionType":"show","logicType":"all","rules":[{"fieldId":"1","operator":"is","value":"River Club Apartments"}]},
From GF 2.5 this breaks the forms (that have coniditional logic). See https://community.gravityforms.com/t/gf-2-5-7-5-is-broken/10323/8
I'd advice not using this any more and removing it anywhere where it is added.
Correct, this code is redundant since GF 2.5+
Hi, Found the same code aswell, here is a improvement on the AJAX calls!
EDITED: 2019-09-05