Sitecore Forms might work incorrectly due to missing scripts


Description

Some functionality of Sitecore Forms, like client validation, conditions, and so on, might work incorrectly due to missing scripts that must be loaded before a form is rendered. The following JS error might appear:

Uncaught ReferenceError: jQuery is not defined

Solution

Out-of-the-box, Sitecore Forms require an additional MvcOuterLayout.cshtml file to load scripts defined in a form item, in the Scripts field. To add it, a user should follow the "Add the MVC layout" section in the official Sitecore documentation. Note that the scripts referred to are loaded by the @Html.RenderFormScripts() helper and they are physically stored in the your_root/sitecore modules/Web/ExperienceForms/scripts folder.

If a user needs an alternative solution, it is possible to add scripts generated by the @Html.RenderFormScripts() helper manually by themselves, as shown in the following files: