({{, (RefLink[FormControl, paclet:ref/FormControl])[assoc,struct]
represents an editable form in a notebook, with structure specified by struct and current values specified by assoc.}, {, (RefLink[FormControl, paclet:ref/FormControl])[(RefLink[Dynamic, paclet:ref/Dynamic])[x],struct]
represents a form in a notebook in which current values are given by the dynamically updated value of x.}})

OpenersNotesSection(Spacer1)Details

The structure struct can be specified as in (RefLink[FormObject, paclet:ref/FormObject]) or can be a complete (RefLink[FormObject, paclet:ref/FormObject])[…] expression.

Values in the displayed form can be edited without affecting values in (RefLink[FormControl, paclet:ref/FormControl])[…]. The values in (RefLink[FormControl, paclet:ref/FormControl])[…] are updated only when the Submit button is clicked.

OpenersPrimaryExamplesSection(Spacer1)Examples  (5)

OpenersExampleSection0(Spacer1)Basic Examples  (2)

Dynamically update a variable using a (RefLink[FormControl, paclet:ref/FormControl]):

{FormControl[Dynamic[x],"q" -> "Quantity"], Dynamic[x["q"]]}

Use the full (RefLink[FormObject, paclet:ref/FormObject]) specification for better control over the appearance of the (RefLink[FormControl, paclet:ref/FormControl]):

FormControl[Dynamic[x],FormObject[{"name", "please enter your name"} -> "String", AppearanceRules-><|"ItemLayout" -> "Vertical", "Title" -> "Name"|>]]

OpenersExampleSection1(Spacer1)Scope  (1)

The first argument of (RefLink[FormControl, paclet:ref/FormControl]) does not need to be a (RefLink[Dynamic, paclet:ref/Dynamic]) expression:

FormControl[<|"x" -> 3|>, "x" -> "Number"]

But if the first argument is not an association with the right keys, the (RefLink[FormControl, paclet:ref/FormControl]) will not render:

FormControl[blargh, "x" -> "Number"]

OpenersExampleSection3(Spacer1)Properties & Relations  (2)

(RefLink[Manipulate, paclet:ref/Manipulate]) automatically uses (RefLink[FormControl, paclet:ref/FormControl]) when given a (RefLink[FormObject, paclet:ref/FormObject]):

Manipulate[Plot[Sin[a["x"]x],{x, 0,10}], {a, FormObject["x" -> "Number" ]}]

You can use (RefLink[ControlType, paclet:ref/ControlType]) to specify (RefLink[FormControl, paclet:ref/FormControl]) for a given field in (RefLink[Manipulate, paclet:ref/Manipulate]):

Manipulate[GeoGraphics[Polygon[a["country"]]], {{a, <|"country" -> "armenia"|>},"country" -> "Country", ControlType -> FormControl}]

({{DocumentationFooterIconsRelatedFunction.png, ({{See Also}, {(RefLink[InputField, paclet:ref/InputField])  ▪  (RefLink[Manipulate, paclet:ref/Manipulate])  ▪  (RefLink[FormObject, paclet:ref/FormObject])  ▪  (RefLink[FormFunction, paclet:ref/FormFunction])  ▪  (RefLink[FormPage, paclet:ref/FormPage])  ▪  (RefLink[Grid, paclet:ref/Grid])}})}})

({{DocumentationFooterIconsRelatedGuide.png, ({{Related Guides}, {▪(RefLinkPlain[Control Objects, paclet:guide/ControlObjects])}, {▪(RefLinkPlain[Setting Up User Interactions, paclet:guide/SettingUpUserInteractions])}})}})