Closed chibko closed 10 months ago
I saw that the js check if the key includes '-' or '['. May be it should check if the key start with something other than letter ?
formData.forEach(function (value, key) {
if (String(key).includes('-') || String(key).includes('[')) {
console.warn(terminal42/contao-conditionalformfields: skipping "${key}", special characters [-] and brackets are not supported in JavaScript variables.
);
} else {
fnBody += const ${key} = values.get('${key}');
;
}
});
ausi @ madyourday suggests this fix https://github.com/madeyourday/contao-rocksolid-antispam/issues/9
Fixed in 87ac1fc63ea8c7f8a2bc858b59cd26cb74687691
Hi,
Sometimes, JS error occurs on FE on form with rocksolid antispam extension installed. The browser console says "SyntaxError: identifier starts immediately after numeric literal". I dig it and found that the problem is rocksolid antispam create a invisible field with a random name witch may sometines start with digit and cause the conditionalformfields js script to fail. Can you solve this issue ? Regards, Stéphane