SelectOptions Element

The SelectOptions element specifies options for a drop-down list.

Syntax

<SelectOptions
  BlankPattern = "Text"
  Len = "Integer"
  MoreText = "Text">
</SelectOptions>

Attributes

Name Description
BlankPattern Required Text. The BlankPattern attribute is used to generate a localized text pattern for displaying text values for lookup fields that are blank (empty string). In the United States, this is localized as "(Item ^1)". ^1 is replaced with the item ID of the item being referenced.
Len Required Integer. The Len attribute causes the members of the drop-down list to be truncated to the specified number of Unicode characters if they exceed the value of Len. This prevents the drop-down menu from being excessively wide.
MoreText Required Text. The MoreText attribute specifies what is displayed in order to indicate that the string has been truncated (typically an ellipsis, "...").

Remarks

Conditional rendering is based on the display mode. New items use the default value of the field, while items in Edit mode use the current value of the field to set the value of the HTML Selected attribute, with Selected=True added for the default or current value of the item.

For Lookup field types, this element produces the sequence <OPTION VALUE="ID">Title</OPTION>.

Example

The following example constructs a drop-down list box and uses the SelectOptions element to delineate the options.

<HTML><![CDATA[ <SELECT TITLE=" ]]></HTML>
<Property Select="DisplayName" />
<HTML><![CDATA[ " TABINDEX=1 NAME=" ]]></HTML>
<FieldPrefix />
<Property Select="Name" />
<HTML><![CDATA[ "> ]]></HTML>
<Switch>
   <Expr>
      <Property Select="Required" />
   </Expr>
   <Case Value="TRUE" />
   <Default>
      <HTML><![CDATA[ <OPTION Value=""> ]]></HTML>
      <HTML>(None)</HTML>
      <HTML><![CDATA[ </OPTION> ]]></HTML>
   </Default>
</Switch>
<SelectOptions Len="100" MoreText="..." />
<HTML><![CDATA[ </SELECT> ]]></HTML>