0

I have a sitecore form that is working fineon one sxa site. But however if try to use same form on other site then on click of submit its Redirecting to Formbuilder page. Also i check in page source that default formm css and js like jquery-3.4.1.min.js is not there. Any Solution for it ?

  • Have you tried troubleshooting with these steps - sitecore.stackexchange.com/a/25841/4515 ? – Paulson Maclean Aug 19 '20 at 10:37
  • Also, you may need to check whether the script field has the js files - ibb.co/FYknX83 – Paulson Maclean Aug 19 '20 at 10:46
  • @PaulsonMaclean The js files are there i have checked and also I have tried the above steps but still facing the same issue – kuldeep Aug 19 '20 at 10:49
  • Ok, any console errors? – Paulson Maclean Aug 19 '20 at 11:01
  • If it is another site, you might have a different layout right? Are all the required steps done in this layout as well - like adding RenderFormScripts(),.. Sitecore.ExperienceForms.Mvc.Html reference to be added etc.., – Paulson Maclean Aug 19 '20 at 11:03
0

Basically the default Sitecore Forms JS files should be present/referenced when you inspect or view the page source as below:

enter image description here

In your case, you said these JS files are not present. So, you need to call the @Html.RenderFormScripts() before the end of the body tag and see if the above script files are added to the page. Now you should be able to submit the form successfully without any problems.

This approach has worked for me when calling @Html.RenderFormScripts() in the head section did not add the default JS files to the page html. This maybe due to other scripts that are referenced in the beginning of the head section.

So, the layout should now look like this :

@using Sitecore.ExperienceForms.Mvc.Html
<!DOCTYPE html>
<html>
<head>
    @Html.RenderFormStyles()
    @Html.Sitecore().VisitorIdentification()
    . . . . . . .
</head>
<body>
  . . . . . 
  @Html.RenderFormScripts()
</body>
</html>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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