Whenever I add JS code within a CRED/FORMS form upon saving there are backslashes added to any apostrophe within the sourcecode. The code breaks and looks weird. This happens on all sites in the newest plugin versions:
Example:
jQuery(\\\\\\\"input[name=\\\\\\\'post_title\\\\\\\']\\\\\\\").limiter(160, elem);
Shane
Supporter
Languages:
English (English )
Timezone:
America/Jamaica (GMT-05:00)
Hi Konstantinos,
Thank you for contacting our support forum.
Does happen as soon as you save the CRED form ?
Could you send me an example of the code that you are using?
Thanks,
Shane
Yes it happens upon saving, on all servers I use Tolset on. Never seen this before.
<b>Example:</b>
jQuery(document).ready(function($){
$("select[name='wpcf-anrede'] option[value='']").text('Anrede');
});
After saving it turns into:
jQuery(document).ready(function($){
$(\"select[name=\'wpcf-anrede\'] option[value=\'\']\").text(\'Anrede\');
});
And then into:
jQuery(document).ready(function($){
$(\\\"select[name=\\\'wpcf-anrede\\\'] option[value=\\\'\\\']\\\").text(\\\'Anrede\\\');
});
Etc. etc. etc.
Shane
Supporter
Languages:
English (English )
Timezone:
America/Jamaica (GMT-05:00)
Hi Konstantinos,
I was able to replicate the issue and escalated it to our 2nd tier supporters for further debugging.
Thanks,
Shane
Shane
Supporter
Languages:
English (English )
Timezone:
America/Jamaica (GMT-05:00)
Hi Konstantinos,
We actually have a patch about this one.
https://toolset.com/errata/quotes-in-the-extra-css-or-js-content-will-get-backslashed/
Please try this and let me know if it helps.
Thanks,
Shane
You are awesome. The fix works like a charm.
Just FYI: The newest Forms Version did not include this fix, had to upload it onto my sites maually again...
It does not work anymore - at least not with the latest Forms version. It is even worse:
The backend shows the code properly but in the source the code is still broken.