Skip to content
Hub Nexus

No author yetClaim it

Version 1Updated 1 min read

Support

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:

ref="my-data" selection="open">

Screen Image

Select1 Control with selection attribute set to be open (Image: The original uploader was Dmccreary at English Wikibooks ., CC BY-SA 3.0)

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:

xmlns="http://www.w3.org/1999/xhtml"
xmlns:xf="http://www.w3.org/2002/xforms">

XForms Select1 Control Using Open Selection
type="text/css">

xmlns="">

XForms Select1 control using selection="open"

ref="CountryCode" selection="open">
Country:

USA
usa

Canada
can

Japan
jpn

Mexico
mex

Other
other

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".

Where this page came from

This page was imported from Wikibooks. From “XForms” on Wikibooks, by its contributors, under CC BY-SA 4.0. Changed here: set as a page; navigation and edit links left out; each image under its own licence, credited in its caption.

Nobody has written it yet — it is the source material at a new address, which is why search engines are asked to skip it and why no one earns from it. It is up for grabs: take it on, and it is yours to rewrite and to earn from.

Get each new page of

XForms

Following means one email when a page is added, nothing when a page changes.

Following means one email when a page is added, nothing when a page changes.

Comments

Spinner Logo

Next in XForms

CC BY-SA 4.0
Note that in this program we use appearance="full" attribute. ## XForms Application [Load XForms Application]( Note that as you select multiple items a space-delimited list of items appears in the output. This is a good example of why you do not want to put any spaces in a selection item **value** t
CC BY-SA 4.0
Make sure to put the page into edit mode if you want to copy and paste the code. This is because Wiki software replaces the ampersand-lt-semicolon with a "&". xmlns=" xmlns:xf=" xmlns:xs=" xmlns:ev=" Select County type="text/css"> @namespace xf url(" body { font-family: Helvetica, sans-serif; font-s
CC BY-SA 4.0
XForms, Select1 Multi-Column
CC BY-SA 4.0
xmlns=" xmlns:xf=" Getting Selection List Data From the XForms Model type="text/css"> body {font-family: Helvetica, Verdanan, sans-serif;} ]]> id="my-item" xmlns=""> red id="code-tables" xmlns=""> ItemColorCode Red red Orange orange Yellow yellow Green green Blue blue Getting Selection List Data Fro
CC BY-SA 4.0
In this example the file that contains the codes is just a well-formed XML file in the same directory that the form is located in. ## Loading XML instance data from a local file or web service The following code fragment, usually in the HTML head, demonstrates how to read XML data from a local file
CC BY-SA 4.0
Click on the calendar icon and select a date. Note that you can change the day and the month using the calendar picker. ## Discussion The key line is: nodeset="MyDate" type="xs:date" /> Note that if you do not use the bind command, the input will work like an ordinary text field. The format that is