Configure a list field on a web form

Current version: 9.0

In a web form, you can specify options that you want displayed in a list field.

A list field lets users select one or more options from a predefined group of values. List fields can have both a value and text. The value is stored in the database and used for statistics.

The text is what visitors see on the form, and this can be different from the value, for example, you can enter a user-friendly text in the Text field.

You can also use the Text field to add different language versions of a list item to your web form, enabling you to localize existing list field items.

This topic describes how to:

Note

You can also specify the items to display in a list field by selecting Sitecore items with the help of XPath queries, Sitecore queries, or fast queries.

Add a list field to a web form by entering list items manually

To manually enter the values that you want to display in a check box list:

  1. In the Form Designer, in the Type field for the relevant field, select the type of list field that you want to add, for example Checkbox List.

  2. In the left pane, in the List section, click the Browse  button by the Items field.

  3. In the List Items dialog, in the Set items by field, click the drop-down arrow and select Manually entering names.

  4. To display a text field where you can enter a customized, user-friendly text, click Display a different text on the form.

    Note

    List fields can have both a value and text. The value is stored in the database and used for statistics. This can also be what visitors see on the form.

  5. In the Value field, enter the value that is stored in the database. To show a different text on the form, in the Text field, enter the text that you want to display.

    Note

    You must always enter something in the Value field. If you leave the Text field blank (or if you click Display values as text on the form), the text entered in the Value field is displayed on the form. If there are two or more identical values in the Value field, only the first value is saved.

  6. To add a new line, click .When you have finished entering the text to display on the form, click OK.

  7. Click Save or Save/Close to save the changes.

    The form looks something like this:

Add a list field to a web form by selecting Sitecore items

To select Sitecore options to display in a list field:

  1. In the Form Designer, in the Type field for the relevant field, select the type of list field that you want to add, for example Checkbox List:

  2. In the left pane, in the List section, click the Browse  button by the Items field.

  3. In the List Items dialog box, in the Set items by field, click the drop-down arrow, and select Selecting Sitecore Items.

  4. In the Selected Root Item field, click Browse.

  5. In the Select a data source for the control dialog box, navigate to the item on your website that contains the subitems corresponding to the field values that you want to display. For example, the Customers information item contains subitems corresponding to subscription types. Select the relevant item, and then click Select.

    In the List Items dialog box, the subitems are now listed. The values in the Value column are stored in the database while the values in the Text column are displayed on the form.

    Note

    By default, Sitecore displays the Item Name field in the Value column, but you can select any of the other fields as the value. You can also display a different field in the Text column. This enables you to display an alternative, more user-friendly label on the form, for example, by selecting the Display name field.

  6. To select another item field, click in the Text or Value column and select the relevant field:

  7. Click OK.

  8. In the Form Designer, click Save or Save/Close to save the form changes.

    This is how the list field looks on your site:

Add a different language version of a Sitecore list item

You can localize the items in the list to a different language version, but only if these items have the relevant language version.

  1. In the Form Designer, open the web form that you want to translate.

  2. In the ribbon, in the Language group, click the relevant language.

  3. Select the list field and in the left pane, click the Browse  button by the Items field.

  4. In the List Items dialog box, in the Text column, replace the text in the fields with the relevant translations.

    Note

    To add a different language version of a list item manually, in the List Items dialog box, click Display a different text on the form. In the Text field that appears for each value, enter the relevant translations.

    The value displayed in the Text column is shown on the form. If the field specified in the Text column is blank, the translated version will not contain anything in this field.

Do you have some feedback for us?

If you have suggestions for improving this article,