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 ?
Basically the default Sitecore Forms JS files should be present/referenced when you inspect or view the page source as below:
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>