Non-textual Values

RequiredFieldIndicator

"RequiredFieldIndicator" applies a function to the labels of the required fields.

In[13]:=

Out[13]=

ItemLayout

"ItemLayout" can be used to decide the way the elements are displayed in a grid. Empty rows and columns are automatically elided.

The default "Horizontal" corresponds to a 2×2 grid.

In[19]:=

Out[19]=

"Inline" corresponds to all the elements laid out on the same row.

In[21]:=

Out[21]=

"Vertical" corresponds to all the elements laid out on the same column.

In[22]:=

Out[22]=

Multipage Forms

Forms can span multiple pages; an additional list in the first argument specifies a multipage form.

In[23]:=

Out[23]=

All pages except the first can be specified as pure functions; doing so will let you have new pages that depend on the old ones.

In[24]:=

Out[24]=

You can use this technique to create new fields programmatically.

In[26]:=

Out[26]=

Note that fields in different pages can have the same key. If this happens, the newest value will overwrite the old.

Dynamic Forms

Sometimes it is useful to define a form where one field depends on another and where both appear on the same page. This can be done by using the Wolfram Language templating language, with symbols such as TemplateSlot.

In[59]:=

Out[59]=

Fields that depend on other fields are automatically hidden until there is enough information to display them, while fields that have other fields depending on them automatically submit when filled in.

Autosubmitting

You can force a field to automatically submit the whole form when it is filled in by wrapping it with AutoSubmitting.

In[60]:=

Out[60]=

Note that when selecting the second field after typing in the first, the whole form is submitted, resulting in a failure message below the second field.

RepeatingElement and CompoundElement

Sometimes it is useful to have a variable number of fields in a form. Use RepeatingElement to repeat a field.

In[1]:=

Out[1]=

Using the second argument of RepeatingElement, you can make a subfield depend on its index.