2

When loading a page containing a Sitecore form, the console displays exceptions related to the version of JQuery. (Note that the form in question includes validation for some of the fields.) I'm not certain where the JQuery is being called by the form/page.

FWIW, there's a later version of JQuery on the server but, as mentioned, it's not being called.

Really appreciate any help with trying to fix this issue!

Console Image with Error

2
  • You are using WFFM in Sitecore 10.2 version. Have you done any upgrade? Mar 30, 2023 at 15:16
  • I can see that the script is loaded from /sitecore modules/Web/ExperienceForms and it means you are using Sitecore Forms rather than WFFM. I removed mentions of WFFM from the question to avoid confusion.
    – Anna Gevel
    Mar 30, 2023 at 17:15

3 Answers 3

1

The jQuery script version is defined in the Scripts field of your forms main items in Sitecore. Normally it should be inherited by the value defined in the Form template's Standard Values item (/sitecore/templates/System/Forms/Form/__Standard Values).

The correct value of this field in Sitecore 10.2 should be:

jquery-3.4.1.min.js|jquery.validate.min.js|jquery.validate.unobtrusive.min.js|jquery.unobtrusive-ajax.min.js|form.validate.js|form.tracking.js|form.conditions.js

I would check the value of this field in your forms, in case it has been overridden at item level. If the value comes from the Standard Values of the Form template, it should show the Standard Value label close to it:

enter image description here

If it doesn't and it shows an incorrect value targeting an older version of jQuery (like in the image below), it means that the value is defined at item level and you will need to fix it in all the forms that have a different value:

enter image description here

1
  • To extend on what Alessandro said... I upgraded to v10.x and my Forms retained the standard value from when they were created. If you highlight the Form in Content Tree and "Reset Fields" from the versions tab, you can update the value to the appropriate standard value.
    – Steve
    Nov 1, 2023 at 15:10
0

The scripts referred to are loaded by the @Html.RenderFormScripts() helper that is added to your layout file under the body section. You can check the official Sitecore document on how it is being added.

And they are physically stored in the your_root/sitecore modules/Web/ExperienceForms/scripts folder.

Finally, if you are getting the jQuery is not defined errors then you can match your jquery version on the server.

Reference document:

https://support.sitecore.com/kb?id=kb_article_view&sysparm_article=KB0267285

Hope this helps.

0

If you are still facing the issue and incase your Sitecore instance is running with SXA, its worth to check out your scripts loading from Themes section.

Sitecore Forms on Submit: Cannot read property 'unobtrusive' of undefined

Do check my answer in above question.

I was also facing issue the same issue with Sitecore forms while sending mail(multiple versions of JQuery referred in page).

Hope it helps!!!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.