1

I'm using Sitecore 9 Forms currently (not WFFM forms). After adding a Single-Line Text element, when I look at the HTML output generated by the form, I noticed that there are 2 additional hidden input fields getting added by default, before the label and input elements corresponding to the text field. It's usually in this format as show below (displaying the GUIDs with string "guid"):

<div data-sc-field-key="guid" class="abc">
    <input id="fxb_guid_Fields_Index_guid" name="fxb.guid.Fields.Index" type="hidden" value="guid"> <!-- what is this used for? -->
    <input id="fxb_guid_Fields_guid__ItemId" name="fxb.guid.Fields[guid].ItemId" type="hidden" value="guid"> <!-- what is this used for? -->
    <label for="fxb_guid_Fields_guid__Value" class="abc" id="abc">Label</label> <!-- Label for textfield -->
    <input id="fxb_guid_Fields_guid__Value" name="fxb.guid.Fields[guid].Value" class="abc" type="text" .....> <!-- Input for textfield -->
</div>

What are the function of these input elements and if possible, where can I see how it is being used in the source code?

1 Answer 1

3

Both hidden inputs (fxb_guid_Fields_Index_guid and fxb_guid_Fields_guid__ItemId) usually contain the same value which is the ID of the field item.

If you copy the value and search for it in Sitecore, you will see that it's a field item under /sitecore/Forms/YOUR_FORM/Page/Section/Field Name.

Why it's there? So Sitecore can save it with right id in the database and that it can process proper mappings when executing save actions.

Code which uses them is Sitecore code. You may try to decompile Sitecore dlls with 'Forms' in their name.

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.