XForms/Open Selection

Motivation
You want to have a control that suggests a set of values in a drop-down list but also allows a user to type in their own value.

Method
Just add the attribute selection="open" to your select1 control:

Screen Image


Note that although a list of possible countries is listed, the user can type in any country that is not on this list.

XForms Application
Load XForms Application

The following example allows you to select a country code or enter your own country code:

  XForms Select1 control using selection="open"  Country:  USA usa   Canada can </xf:item> <xf:item> <xf:label>Japan</xf:label> <xf:value>jpn</xf:value> </xf:item> <xf:item> <xf:label>Mexico</xf:label> <xf:value>mex</xf:value> </xf:item> <xf:item> <xf:label>Other</xf:label> <xf:value>other</xf:value> </xf:item> </xf:select1> Output: <xf:output ref="CountryCode"/>

Discussion
Very often you want to suggest values to the user to ensure consistency of data entry. The problem is that there are sometimes exceptions to a small list of items and the open selection control allows these exceptions to be entered.

One challenge of using this control is to let the user know they can enter an exception. You may have to add instructional text on the form such as "type value in this field if it does not appear on this list".