Sauter la navigation

[Résolu] Inline jQuery with escaped characters breaks after exporting and importing

This support ticket is created Il y a 5 années et 1 mois. 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
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

Ce sujet contient 1 réponse, a 2 voix.

Dernière mise à jour par Minesh Il y a 5 années et 1 mois.

Assisté par: Minesh.

Auteur
Publications
#1548513

I am trying to:

Export a cred form with the following inline jQuery

jQuery( "input[name=participants\\[\\]]" ).each(function() { ...

and import this cred form into another site.

On the target site, this results in this inline code:

jQuery( "input[name=participants\[\]]" ).each(function() { ...

causing the brackets to not be escaped properly anymore and this breaks the jQuery.

#1549417

Minesh
Supporter

Les langues: Anglais (English )

Fuseau horaire: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

I think you are using the wrong syntax as rather adding the slash to escape the brackets, you should try to use the following method.

As you can see - I've removed the slashes and wrapped the field name in single quotes: 'participants[]'
For example:

jQuery( "input[name='participants[]']" ).each(function() {

And then save your form, export it and later try to import it. It should work. 🙂