FormLayoutFunction

FormLayoutFunction
is an option for FormObject and FormFunction that can be used to specify how to lay out a form.

DetailsDetails

  • FormLayoutFunction is a pure function that is applied to the FormObject to extract the layout.
  • Various pieces of the layout can be extracted by either FormObject[][key], which extracts the complete field, or FormObject[][key,prop], where prop can be one of the following:
  • "Control"bare control of the field, e.g. InputForm
    "Label"unformatted label of the field
    "Help"help text associated with the field
    "Failure"message of the current failure, if applicable
    "Required"whether the field is required for submission
    "Hint"hint text, usually associated with the FieldHint option
    "Masked"whether to mask the field (see FieldMasked)
    "Hidden"whether a field should be hidden
  • Other pieces of the layout are stored in the AppearanceRules and can be accessed by using FormObject[][AppearanceRules,prop].
  • AppearanceRules can contain arbitrary key-value pairs, but typical values of prop 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
    "CancelLabel""Cancel"text for the cancel button
    "ItemLayout""Horizontal"layout for a single element

ExamplesExamplesopen allclose all

Basic Examples  (3)Basic Examples  (3)

Create a custom layout and style the elements:

In[1]:=
Click for copyable input
Out[1]=

Complete fields can be accessed by their key:

In[1]:=
Click for copyable input
Out[1]=

Single elements of the complete field can be individually accessed as well:

In[1]:=
Click for copyable input
Out[1]=
Introduced in 2014
(10.0)