The Form component for Retool Mobile
A form to group and submit input fields.
Properties
All properties for this object with supported data types or values. You can write JavaScript almost anywhere in Retool to manipulate or read property values.
align
The horizontal alignment of the contents.
Type | string | ||||||||
Format | Plain Text | ||||||||
Mutability |
| ||||||||
Allowed Values |
| ||||||||
Default |
|
Examples
"center"
data
The data.
Type | string | number | boolean | object | array | ||||||
Format | Custom data | ||||||
Mutability |
|
disabled
Whether input, interaction, selection, or triggering is disabled.
Type | boolean | ||||||
Format | True/False | ||||||
Mutability |
| ||||||
Default |
|
Examples
true
disableSubmit
Whether to disable form submission.
Type | boolean | ||||
Mutability |
|
enableFullBleed
Whether to expand the contents to fill available space.
Type | boolean | ||||
Format | True/False | ||||
Mutability |
| ||||
Default |
|
Examples
true
footerPadding
The amount of padding used within the footer.
Type | string | |||||||||
Format | Plain Text | |||||||||
Mutability |
| |||||||||
Allowed Values |
| |||||||||
Default |
|
Examples
"8px 12px"
gap
The gap between components.
Type | string | ||||||||||||||||||||||||
Mutability |
| ||||||||||||||||||||||||
Allowed Values |
|
headerPadding
The amount of padding used within the header.
Type | string | |||||||||
Format | Plain Text | |||||||||
Mutability |
| |||||||||
Allowed Values |
| |||||||||
Default |
|
Examples
"8px 12px"
hidden
Whether this object is hidden from view.
Type | boolean | ||||||
Format | True/False | ||||||
Mutability |
| ||||||
Default |
|
Examples
true
hoistFetching
Whether to display a loading indicator whenever nested objects are fetching data.
Type | boolean | ||||
Format | True/False | ||||
Mutability |
| ||||
Default |
|
Examples
true
id
The unique identifier (name).
Type | string | ||||
Format | Plain Text | ||||
Mutability |
| ||||
Default |
|
Examples
query1
button1
initialData
The data used to populate default values for input fields.
Type | array |
Array values | object |
Mutability | Read-only |
isHiddenOnDesktop
Whether to show or hide this object in the desktop layout.
Type | boolean | ||||
Format | True/False | ||||
Mutability |
| ||||
Default |
|
Examples
true
isHiddenOnMobile
Whether to show or hide this object in the mobile layout.
Type | boolean | ||||
Format | True/False | ||||
Mutability |
| ||||
Default |
|
Examples
true
justify
The horizontal alignment of the contents.
Type | string | ||||||||||
Mutability |
| ||||||||||
Allowed Values |
|
layout
The layout of content.
Type | string | ||||||
Mutability |
| ||||||
Allowed Values |
|
loading
Whether to display a loading indicator.
Type | boolean | ||||
Format | True/False | ||||
Mutability |
| ||||
Default |
|
Examples
true
maintainSpaceWhenHidden
Whether to take up space on the canvas if hidden
is true
.
Type | boolean | ||||
Format | True/False | ||||
Mutability |
| ||||
Default |
|
Examples
true
margin
The amount of margin to render outside.
Type | string | |||||||||
Format | Plain Text | |||||||||
Mutability |
| |||||||||
Allowed Values |
| |||||||||
Default |
|
Examples
4px 8px
padding
The amount of padding to render inside.
Type | string | ||||||
Format | Plain Text | ||||||
Mutability |
| ||||||
Allowed Values |
| ||||||
Default |
|
Examples
4px 8px
requireValidation
Whether all input fields must be valid to submit. If valid is false
for any input field, the Invalid event handler is triggered.
Type | boolean |
Mutability | Read-only |
resetAfterSubmit
Whether to reset input field values using initialData
after form submission.
Type | boolean |
Mutability | Read-only |
showBorder
Whether to show a border.
Type | boolean | ||||
Format | True/False | ||||
Mutability |
| ||||
Default |
|
Examples
true
showFooter
Whether to show the footer area.
Type | boolean | ||||||
Mutability |
|
showFooterBorder
Whether to show a border above the footer.
Type | boolean | ||||
Format | True/False | ||||
Mutability |
|
Examples
true
showHeader
Whether to show the header area.
Type | boolean | ||||||
Format | True/False | ||||||
Mutability |
| ||||||
Default |
|
Examples
true
showHeaderBorder
Whether to show a border under the header.
Type | boolean | ||||
Format | True/False | ||||
Mutability |
| ||||
Default |
|
Examples
true
showInEditor
Whether the component remains visible in the editor if hidden
is true
.
Type | boolean | ||||
Format | True/False | ||||
Mutability |
| ||||
Default |
|
Examples
true
tooltipText
The tooltip text to display next to the label on hover.
Type | string | ||||
Format | Markdown | ||||
Mutability |
| ||||
Default |
|
Examples
Submit
Methods
JavaScript API methods for this object. You can write JavaScript almost anywhere in Retool and use methods to manipulate data and property values.
form.clearValidation()
Examples
Clear the validation message from form
.
form.clearValidation();
form.reset()
Examples
Reset form
.
form.reset();
form.setData(data)
Parameters
form.setDisabled()
Set the disabled
value to toggle whether the input field is disabled. Defaults to true
without a parameter.
form.setDisabled(disabled)
Parameters
disabled
Whether input, interaction, selection, or triggering is disabled.
Type | boolean |
Format | True/False |
Default |
|
Examples
true
Examples
Disable form
.
form.setDisabled(true);
Enable form
.
form.setDisabled(false);
form.setHidden()
Set the hidden
value to toggle whether the component is visible. Defaults to true
without a parameter.
form.setHidden(hidden)
Parameters
Examples
true
Examples
Hide form
.
form.setHidden(true);
Unhide form
.
form.setHidden(false);
form.setShowBody(showBody)
Examples
Show the body of form
.
form.setShowBody(true);
Hide the body of form
.
form.setShowBody(false);
form.setShowFooter(showFooter)
Examples
Show the footer of form
.
form.setShowFooter(true);
Hide the footer of form
.
form.setShowFooter(false);
form.setShowHeader(showHeader)
Parameters
Examples
true
Examples
Show the header of form
.
form.setShowHeader(true);
Hide the header of form
.
form.setShowHeader(false);
form.validate()
Examples
Validate the value of form
.
form.validate();
Events
Events triggered by user interactions. You can configure event handlers in the IDE to trigger queries or other actions in response to events.
Event | Description |
---|---|
Invalid | A value is invalid. |
Submit | The value is submitted. |