0

I am using Sitecore 9.0.1 with SXA 1.7 and I have created a form using Sitecore Forms and attached that form to a page through CMS and for the page I have assigned my Page design to it but it is not showing my header and footer design which is there in my page design.

Below are the steps which i followed to add my form to page:

1.Created a landing page and through presentation details i added my form to the page. with the placeholders as "mainn" specified in my VS layout.

enter image description here

2.Same placeholder i have created under my Placeholdersettings

enter image description here 3.For the landing page i assigned my page design under page design section

enter image description here

This is the result I am getting: without page design:

enter image description here

I created one more page and added this rendering through experience editor there I am able to see my page design (header and footer) but on click on form submit it is redirecting to some formid URL and extra added sxa components are also not visible

enter image description here

Result what I am getting when I click submit button:

Url which it is redirecting to "sitecore901.local/formbuilder?fxb.FormItemId=8516cac6-205f-4040-9540-4fd1d787355e&fxb.HtmlPrefix=fxb.513f7c6f-97ac-4f24-8258-6fa184628d02 " and other sxa components added are also not showing up.

enter image description here

Workaround :

Added sitecore form wrapper and inside this i added the MVC form and specified the datasource form is also appearing on the page and its not redirecting and the placeholder for form is changed to this "/main/container-1/sitecoreFormsWrapper-1"(if i change it to "mainn" i am not able to see my page design so i have kept as it is) .But the sitecore form validations which i have applied for chinese is not working.

I specified the script in my VS under Renderbody() function of form

enter image description here

The result what i am getting now is:

enter image description here

I tried specifying that script file under script field of form but still the same issue.

enter image description here

enter image description here

Can anyone please help what needs to be done here?

1
  • 1
    Just make sure, you first dragged the Sitecore Form Wrapper rendering on the page, then in this rendering you placed MVC Form rendering and then select the form. Commented Apr 22, 2021 at 4:21

1 Answer 1

1

Make sure you're following all the below steps to add a form to a page::

  1. Open the Toolbox. In the Forms section, select and drag the Sitecore Form Wrapper rendering to the relevant placeholder.

enter image description here

  1. After that, drag an Mvc Form rendering to the Sitecore Forms Wrapper.

enter image description here

  1. After dragging the Mvc Form onto the page, In the Select the Associated Content dialog box, select the form that you want to display on the page and click OK. The form is now displayed on the page.

  2. In the Experience Editor, click Partial Design and click Metadata. In the SXA Toolbox, in the Forms category, drag and drop the Forms Scripts component before the closing /body tag of the page.

enter image description here

4
  • i followed your steps form is working fine now but validations which were displaying in chinese is now displaying in english i have the validation scripts in my deployed instance folder how can i add it here under form scripts
    – Vinaya
    Commented Apr 22, 2021 at 5:55
  • have you added reference to that validation script in the Scripts field of Sitecore Forms? Commented Apr 22, 2021 at 6:35
  • no actually this is a multilanguage site so i have given reference in the View where renderbody() of the form comes in VS @Raman Gupta
    – Vinaya
    Commented Apr 22, 2021 at 6:55
  • updated the workarounds please have a look @Raman Gupta
    – Vinaya
    Commented Apr 22, 2021 at 7:22

Your Answer

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

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