In an sxa site, I have a custom sxa component with a placeholder item to load the form. enter image description here In the page using this component, I have added a 'Sitecore form Wrapper'=>'Mvc Form' component using experience editor. The layout file has @Html.RenderFormScripts() just before closing the body tag.

The form works fine in CM servers and Local instances.

Here is the issue Im facing.

When I load the page from CD server for the first time after publishing anything, the form loads fine and from the view-source: I can see the form related scripts are added to the page. enter image description here

But when I do a page refresh, page does not load those scripts and form functionalities(like ajax, recaptcha, etc) are not working and when I check the view-source: these scripts are missing. enter image description here

I tried to add a mvc form directly to the page without any rendering variant and its working but inside a rendering variant this issue I'm facing.

The form is very simple with just a text box enter image description here

What might be the issue here.

Sitecore Version: 9.3 with SXA

  • 1
    Have you added caching to either the Sitecore form Wrapper or Mvc Form components for your site?
    – Richard Seal
    Commented Oct 19, 2020 at 18:29
  • No caching added to the components, also without rending variant its working fine
    – Jojo
    Commented Oct 19, 2020 at 19:20
  • 2
    This is likely a caching issue, either directly on the forms wrapper component or a parent component. You can verify by disabling caching and checking again.
    – jammykam
    Commented Oct 19, 2020 at 20:09
  • @jammykam - thanks, Checked by disabling cache for the parent component working, dont understand why its causing this issue. We are using cdn and I tried clearing that cache but issue arise again if I enable caching.
    – Jojo
    Commented Oct 20, 2020 at 3:10


Your Answer

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

Browse other questions tagged or ask your own question.