Skip Navigation

[Resolved] cred js editor adds \ to the code

This thread is resolved. Here is a description of the problem and solution.

Problem: I am trying to add custom JavaScript to a Form's JS editor panel, but after saving I can see that the code has been escaped with backslashes.

Solution: Apply the patch found in the erratum post below for now. Our developers will include a permanent fix for this issue in an upcoming Forms release.

Relevant Documentation:
https://toolset.com/errata/quotes-in-the-extra-css-or-js-content-will-get-backslashed/

This support ticket is created 6 years, 5 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

This topic contains 6 replies, has 2 voices.

Last updated by Christian Cox 6 years, 4 months ago.

Assisted by: Christian Cox.

Author
Posts
#951394
js-cred.jpg

I am trying to: add js code to post create form in cred, i whant to add the code from this post- https://toolset.com/forums/topic/default-value-select-taxonomy-term-in-cred/#post-597561

I expected to see: jQuery(document).ready(function($) {
jQuery("select[name^='שחור'] option[value='שחור']").attr("selected","selected"); });

Instead, I got: jQuery(document).ready(function($) {
jQuery(\"select[name^=\'שחור\'] option[value=\'שחור\']\").attr(\"selected\",\"selected\"); });

#951602

Hi, I apologize for the inconvenience here. It appears that a bug was introduced in a recent Forms release, causing quotation marks to be over-escaped. We have escalated this issue to the developers, and hope to have a fix available soon. I will keep you posted here as I receive more information about this problem.

#951604

Hi, thanks.
so for now how can i create the cred post submit form for 1 pre fix taonomy?
my client need this asap...
BR
Ronen

#951605

If the page containing the Form is designed with Layouts, you can move this code into Toolset > Layouts CSS and JS. If not, then you can add a simple View to the page with the Form, and include this code in the View's Loop Editor JS panel. If neither of these options will work, you can enqueue this code in an external JavaScript file in your theme.

#953129

Our developers have released a patch for this issue and published an erratum post here: https://toolset.com/errata/quotes-in-the-extra-css-or-js-content-will-get-backslashed/

Please install the patch using the instructions provided in the post, and let me know if the issue is not resolved.

#955583

Thank you very much for your help...

#1099561

Forms 2.1 has been released, including a permanent fix for this issue.