Add styles and scripts to Sitecore Forms
For your customized forms to function and display correctly, you must add the styles and scripts you require to Sitecore.
To add styles and scripts to Sitecore Forms:
-
In the Content Editor, go to sitecore/Forms, click the form that you want to add a script or style to and, in the Scripts or Styles field, add the name of your custom script or style file.
NoteIf you want the script or styles to be available for all forms, you must update the settings on the standard value item: sitecore/Templates/System/Forms/Form/__Standard Values.
-
Add custom style or script files to the following folders:
-
Styles:
<siteroot>/sitecore modules/Web/ExperienceForms/css
-
Scripts :
<siteroot>/sitecore modules/Web/ExperienceForms/scripts
-
-
Add the following methods in your layout to render the files:
-
@Html.RenderFormStyles()
-
@Html.RenderFormScripts()
-
-
Add autocomplete lists for the Form designer to use with the CSS Class and CSS Class Label fields if required.