1

We are using sitecore forms with Sitecore 9.3 and facing the below issue on one of the lower environments.

When we add "Section", the below div structure generates

<div class="form-section">
 <div class="row">
  <div data-sc-field-key="SITECOREID">
    All ELEMENTS
  </div>
 </div>
</div>

Below is a screenshot from the content editor for the form enter image description here

We have packaged the form to another environment with the same setup, but the HTML generates as below

<div data-sc-field-key="SITECOREID">
    All ELEMENTS
</div>

Below is a screenshot from the content editor for the form enter image description here "form-section" and "row" Divs are missing. Could you help in identifying how the structures are generated for the Forms ?

8
  • The OOTB structure of the section contains <div data-sc-field-key="@Model.ConditionSettings.FieldKey" class="@Model.CssClass">. Can you check if something is modified in the section.cshtml on the higher environment? Commented May 31, 2023 at 12:30
  • section.cshtml is exact same as you mentioned in both the environments
    – D J
    Commented May 31, 2023 at 13:20
  • The 2 divs are not rendered at all on the other environment. the example in my question is the exact html structure being generated for the section.
    – D J
    Commented May 31, 2023 at 13:21
  • @MarekMusielak, I could not see these classes anywhere in option on "section" on the form in content editor or form editor and unable to identify how these 2 wrapper divs are generated in one environment.
    – D J
    Commented May 31, 2023 at 13:24
  • Can you provide a screenshot from Content Editor with forms from both environments?
    – Marek Musielak
    Commented May 31, 2023 at 13:37

1 Answer 1

0

This seems to point towards some customisation that was applied in one environment but not the other.

I just did a scan of a vanilla 93 installation and I couldnt find any reference to "form-section".

That being the case, please check this path in the both environments: /sitecore/system/Settings/Forms/Field Types/Structure/Section and confirm that the View Path field is set to FieldTemplates/Section.

If both are the same, please then do a full scan of the lower environment to find where exactly the HTML <div class="form-section"> is coming from, as I dont believe this to be OTB.

1
  • Hello Dean, I have verified the View path of "/sitecore/system/Settings/Forms/Field Types/Structure/Section" on both the environment, Its set to "FieldTemplates/Section". I could not find the "form-section" class in any files under "Views\FormBuilder". Let me know, if there is a way to change the html structure of the OTB Form elements.
    – D J
    Commented Jun 5, 2023 at 14:32

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.