Listing of Field Types »


represents a form with fields having names namei that take data of type typei.


uses labeli as the label for the field named namei.


uses full specification associ for a field, and objj as part of the layout of the form.

Details and Options

  • FormObject[] displays in a notebook interface as a form with fields that can be filled in, either by entering text or using other controls.
  • FormObject can be used to specify the structure of a form in FormFunction.
  • When evaluated, FormObject[] is converted to FormObject[fields], in which each entry in fields has a full specification of the form "namei"->associ. The elements of the full specification associ include:
  • "Input"the raw input, if any, for the field (often a string)
    "Interpreter"the interpreter to be used for the field
    "Required"whether input is required for the field
    "Default"a default value, if any, for the field
    "Control"the type of control to provide for the field
    "AutoSubmitting"whether entering the field automatically submits the form
    "Disambiguation"whether to ask for disambiguation of interpretations
    "Label"a label to display for the field
    "Hint"hint to display inside an input field
    "Masked"whether to mask input given in an input field
    "Help"help to associate with the field
  • Setting[FormObject[]] gives an association of the form <|"name1"->val1,|>, where the vali are the values obtained by interpreting the "Input" element associated with each "namei" according to the "Interpreter" associated with the "namei".
  • If "Input" is missing, or "Interpreter" fails, then the value of "Value" is a Failure object.
  • FormObject[][<|"name1"->input1,|>] yields a FormObject[] in which the "Input" corresponding to each of the namei included has been replaced with inputi.
  • In FormObject[{,objj,}], the objj can be Delimiter, representing a horizontal delimiter.
  • They can also be expressions with heads Style, Row, Item, Text, ExpressionCell, and TextCell, as well as views and layout constructs such as TabView and Grid.
  • In FormObject[{"name1"->type1,}], the typei are used to give values for "Interpreter" in the full specification.
  • Possible forms of type specifications are:
  • "form"any form supported by Interpreter
    Restricted[],etc.any restricted form etc. supported by Interpreter
    Interpreter[]any complete Interpreter object
    tfunany function to be applied to the raw input
  • If only "namei" is given, without a rule giving typei, then the interpreter is assumed to be Identity, so that the value is exactly whatever is given as the corresponding "Input" element.
  • By default, the control used for each field is determined by the type of input specified. For type "String", a single line of input is by default expected on the web; typing "Text" yields a multiline text field.
  • Possible controls explicitly given as the value associated with "Control" include InputField, PopupMenu, Slider, and RadioButtonBar.
  • The specification "namei"->AutoSubmitting[typei] indicates that when the field associated with namei is entered, the whole form should automatically be submitted.
  • FormObject[AutoSubmitting[spec]] indicates that a form should automatically be submitted whenever any of its fields are entered.
  • Overall options for FormObject include:
  • AppearanceRulesAutomaticassociation giving overall appearance rules
    FormLayoutFunctionAutomaticfunction to generate final layout for the form
    PageThemeAutomaticoverall theme to use when the page is deployed
  • Typical elements in the setting for AppearanceRules include:
  • "Title"Noneoverall title for the form
    "Description"Nonedescription to include at the top of the form
    "RequiredFieldIndicator"Noneindicator to show required fields
    "SubmitLabel""Submit"text for the submit button of the form
    "AddLabel""+"text of the add button for repeating elements
    "DeleteLabel""-"text of the delete button
    "AddTooltip""Add"tooltip for the add button
    "DeleteTooltip""Remove"tooltip for the delete button
    "NextLabel""Next"text of the "next" button for multipage forms
    "ItemLayout""Horizontal"layout of field labels and messages
  • Possible settings for "ItemLayout" include "Horizontal", "Vertical", and "Inline".


open all close all

Basic Examples  (3)

Create an unfilled form:

Click for copyable input
Click for copyable input

Specify inputs for the form as strings:

Click for copyable input

Find the inputs that have been provided for the form:

Click for copyable input

The number has been parsed to an explicit number:

Click for copyable input

This input given for the second field cannot be parsed to a number, so a message is shown:

Click for copyable input

The setting contains a symbolic failure object:

Click for copyable input

Use different controls:

Click for copyable input

Scope  (17)

Generalizations & Extensions  (1)

Options  (2)

Applications  (1)

Properties & Relations  (2)

Possible Issues  (1)

Introduced in 2014