Text Field

The text field component represents the HTML text field control with its label. The structure view below shows the initial text field component as created by drag-and-drop from the toolbar with its element symbol, its label, its properties, and its tooltip and message cells.

The overview to the textfield component

The properties shown in the properties cell define how validation is done. By default, text field content is trimmed (leading and trailing blanks removed) before validation.

The properties cell's first entry is a flag:

Text Field Type

The text field type is specified in the context menu. The following types are available:

Custom

The text field of type "Custom" is the default text field type and is provided for general text input using a regular expression for validation.

The properties cell of the text field below defines that input is trimmed, is optional, is limited to 40 characters, and it must match the regular expression within the slashes: Input must be at least 2 characters and the valid characters are the dash, uppercase and lowercase ASCII letters, digits 0 - 9, the blank, and the period.

The overview of the custom textfield component

A double-click on the properties cell opens the resizable properties dialog below. The dialog allows to specify the regular expression used for validation. An initial value can be set to propose user input. A placeholder text can be set to guide the user or to replace the label in the styled form.

The properties dialog of the custom textfield component
Unfamiliar with regular expressions? A click on the "Create ..." button (left) opens the "Create Expression" dialog (below) that allows to select the valid characters and to set the minimal number of characters.
The pattern properties dialog of the custom textfield component

The above settings could be appropriate for the validation of a name: the valid characters are uppercase and lowercase letters including diacritics (non-English letters like ä or à), digits 0 to 9, the blank ("B. J."), the dash ("B.-J."), the period ("B. J."), and the single quote ("O'Doherty"). Input is optional, but if input is given, it must have at least two characters ("Lì" or "L.").

The diacritics option replaces A-Z and a-z with \p{L…}. Input is not validated by JS (EcmaScript 5) if the regular expression allows Unicode.

Integer

The text field of type "Integer" is provided to enter integers.

The overview to the integer textfield component

The properties cell of the text field below defines that input is required in the range of 0 to 100. An initial value of 0 has been set (in parentheses).

A sample for the integer textfield component

A double-click on the properties cell opens the resizable properties dialog below. The dialog allows to specify the valid numeric range. An initial value can be set to propose user input. A placeholder text can be set to guide the user or to replace the label in the styled form.

The properties dialog of the integer textfield component

Number

The text field of type "Number" is provided to enter numbers.

The overview to the number textfield component

The properties cell of the text field below defines that input is required in the range of 0.00 to 1000.00 (at an accuracy of 2 decimal places). An initial value of 0.00 has been set (in parentheses).

A sample for the number textfield component

A double-click on the properties cell opens the resizable properties dialog below. The dialog allows to specify the valid numeric range and the number of decimal places rendered in the user's browser. An initial value can be set to propose user input. A placeholder text can be set to guide the user or to replace the label in the styled form.

The properties dialog of the number textfield component

Email

The text field of type "Email" is provided for email address input using a regular expression for validation.

The overview to the email textfield component

The properties cell of the text field below defines that input is optional, but if input is given, it must not exceed 128 characters and it must match a regular expression, either the builtin or a custom regular expression. The flag @ indicates that the builtin regular expression is used, otherwise, the custom regular expression is displayed in the properties cell for comparison purposes.

A form sample for the email textfield component

The properties were specified in the resizable properties dialog below (opened by double-clicking the properties cell). The regular expression can be replaced with a better one or restored by clicking the "Restore regular expression" button. An initial value can be set to propose user input or to initiate input. A placeholder text can be set to guide the user or to replace the label in the styled form.

The properties dialog of the email textfield component

URL

The text field of type "URL" is provided for URL input using a regular expression for validation.

The overview to the url textfield component

The properties cell of the text field below defines that input is optional, but if input is given, it must not exceed 128 characters and it must match a regular expression, either the builtin or a custom regular expression. The flag URL indicates that the builtin regular expression is used, otherwise, the custom regular expression is displayed in the properties cell for comparison purposes.

A form sample for the url textfield component

The properties were specified in the resizable properties dialog below (opened by double-clicking the properties cell). The regular expression can be replaced with a better one or restored by clicking the "Restore regular expression" button. Sample text entered into the "Regular expression test" field lets play with the regular expression. An initial value can be set to propose user input or to initiate input. A placeholder text can be set to guide the user or to replace the label in the styled form.

The properties dialog of the url textfield component

Password

The text field of type "Password" is provided for password input using a regular expression for validation.

The overview to the password textfield component

The properties cells of the password field below defines that input is required and must match the regular expression within the slashes: input must be at least 8 characters, and blanks and all characters are valid.

A form sample for the password textfield component

A double-click on a properties cell opens the resizable properties dialog. The dialog allows to specify the regular expression used for validation. An initial value can be set to propose user input or to initiate input. A placeholder text can be set to guide the user or to replace the label in the styled form.

The properties dialog of the password textfield component
Unfamiliar with regular expressions? A click on the "Create simple regular expression ..." button (left) opens the "Create Expression" dialog (below) which allows to select the password's valid characters and to set the minimal number of characters.
The pattern properties dialog of the password textfield component

Date

The text field of type "Date" is provided to enter a calendar date, in custom format and optionally within a range, optionally from a date picker displaying a monthly calendar. The date format can be specified in the settings view.

The overview to the date textfield component

The sample below requests the input of a date within a range of plus 1 to 31 days relative to the current date. The current date plus 1 day (grayed) is the placeholder. Date offsets define relative dates in the future or past (negative number).

A form sample for the date textfield component

A double-click on the properties cell opens the resizable properties dialog.

Properties

A constraint can be set to start or end a valid date. A valid range of dates assigned to by the properties dialog can either be a specified interval of days from the current date, a fixed start date, a fixed end date, or a fixed date interval.

The initial value and the placeholder can be custom text or the current date plus an offset in days. The placeholder can be used to guide the user or to replace the label in the styled form.

This dialog specifies the current date
plus 1…31 days as valid date range.
A dialog specifying the current date plus 1 to 31 days as valid date range
Tomorrow's date is the earliest date, e.g. for an arrival date. The date picker is enabled.
Tomorrow's date is the earliest valid date
A valid date is the current date and
any date in the past.
A dialog specifying the current date and any date in the past as valid date
Any date in the 20th century is a
valid date.
A dialog specifying any date in the 20th century as valid date

Date Parsing

If the date format was specified as e.g. "mmm d, yyyy" with short English month names then the user input below …

  Jan 1, 1980 jan 1 1980 1 1 1980
Jan$%1,$%1980 jan$%1$%1980 1$%1$%1980

… would be parsed tolerantly by JavaScript/PHP and turned into "Jan 1, 1980", accepting the months as ordinal numbers for lazy fallback.

Date Pickers

If the datepicker option was checked in the properties dialog, a click on the HTML date textfield or on a trigger button opens a regular or accessible date picker and enables the user to select a date from a monthly calendar. The date picker is closed by a click on a calendar date or outside of the date picker area. When the date picker is closed after a date selection, the date textfield will show the selected date in the specified date format.

The regular date picker.
A date textfield with a date picker
The accessible date picker.
The accessible date picker