Skip to main content
Version: 8.3 Beta 🚧

Perspective - Form

💡Have feedback for this page? Let us know on the IA Forum.


Component Palette Icon:

Description​

The Form component is a versatile container for creating dynamic and responsive forms in Perspective. It simplifies collecting and validating user input, making it easy to create professional and interactive forms.

Key features include:

  • Responsive Design: Automatically adapts layouts for different screen sizes.
  • Validation Support: Provides built-in and custom validation rules.
  • Flexible Layouts: Configure rows, columns, and widgets to meet your needs.
  • Dynamic Visibility: Conditionally display or enable form elements based on user input.

Properties​

Most properties support binding options. For more information, see Types of Bindings in Perspective.

NameDescriptionProperty Type
disabledDisables all inputs and actions in the form. Default is false.Boolean
readOnlySets all inputs to read-only. Inputs remain focused but cannot be edited. Default is false.Boolean
columnsArray of column configuration objects defining the form structure. See the Columns Properties below for more detail on configuration options.Array
actionsConfiguration object for submit and cancel buttons, including text, style, and behavior settings. See the Actions Properties below for more detail on settings.Object
contextProvides additional context for the form, including metadata and configurations.Object
dataStores user input values using unique widget IDs. Can be used to pre-fill fields dynamically.Object
validationObject containing live validation checks and fields in violation.Object
styleSets a style for this component. Full menu of style options is available for text, background, margin and padding, border, shape and miscellaneous. You can also specify a style class.Object

Columns Properties​

Columns define the overall structure of the form by organizing rows.

NameDescriptionProperty Type
alignDefines the horizontal alignment of row contents within the column.String
justifyDetermines how rows are spaced within the column.String
visibleControls whether the column is visible. Default: true.Boolean
rowsAn array of row objects that define the structure of the form. See the Rows Properties below for more information.Array
styleSets a style for this component. Full menu of style options is available for text, background, margin and padding, border, shape and miscellaneous. You can also specify a style class.Object

Rows Properties​

Rows group widgets inside a column, determining their layout and visibility.

NameDescriptionProperty Type
alignDefines the vertical alignment of widgets within the row.String
justifyDetermines how widgets are spaced within the row.String
visibleControls whether the row is visible. Default: true.Boolean
enabledEnables or disables user interaction with the row. Default: true.Boolean
widgetsAn array of widget objects contained within the row. See the Widgets Properties below for more information.Array
styleSets a style for this component. Full menu of style options is available for text, background, margin and padding, border, shape and miscellaneous. You can also specify a style class.Object
visibleWhenDefines a condition that determines when the row should be visible. If true, the row will be displayed.Object
enabledWhenDefines a condition that determines when the row should be enabled. If false, user input is disabled for all widgets within the row.Object
Widgets Properties​
NameDescriptionProperty Type
idA unique identifier for the widget, used to reference it in scripts and bindings.String
domIDThe HTML id attribute applied to the widget for styling or scripting purposes. Optional.String
typeThe type of widget (e.g., text, number, email, dropdown, checkbox, button).String
inputAn object defining the input properties specific to the widget type.Object
visibleControls whether the widget is visible. Default: true.Boolean
defaultValueThe initial value of the widget when the form loads.Any
layoutConfiguration settings that control how the widget is displayed within the row.Object
labelThe text displayed as the label for the widget.String
infoAdditional help text or tooltip for the widget.String
validationValidation rules for the widget, such as required fields or regex patterns.Object
tabIndexThe tab order index for keyboard navigation. Default: 0.Integer
styleSets a style for this component. Full menu of style options is available for text, background, margin and padding, border, shape and miscellaneous. You can also specify a style class.Object

Actions Properties​

Actions define the behavior of the form's submit and cancel buttons.

NameDescriptionProperty Type
submit

Configuration for the submit action. Includes properties such as:

  • disabled: A boolean defining the enabled state of the submit button.
  • text: Button text.
  • icon: Button icon configuration.
  • style: Button style configuration object.
  • fireComponentEvent: Triggers the onSubmitActionPerformed event when the button is pressed.
  • fireSubmissionEvent: Sends the form data to a Form Submission Event for processing.
  • autoDisable: Automatically enables or disables the button based on form validity and submission state.
  • resetOn: Determines when the form resets, either with success or action. The success option resets the form on successful submission. The action option resets it immediately after submission.
  • awaitResponse: When enabled, the form waits for a response before resetting. Only applicable when fireSubmissionEvent is true.
Object
cancel

Configuration for the cancel action. Includes properties such as:

  • text: The text displayed on the cancel button.
  • icon: The icon displayed on the cancel button.
  • style: Defines the appearance of the cancel button using inline styles or CSS classes.
  • fireComponentEvent: If true, triggers the onCancelActionPerformed event when the cancel button is clicked.
  • disabled: If true, disables the cancel button, preventing user interaction.
  • reset: If true, resets all form fields to their default values when the cancel button is clicked.
Object
disabledControls whether the action buttons are disabled. Default is false.Boolean
fixedWhen true, the action bar remains visible at the bottom of the form. Default is false.Boolean
styleSets a style for this component. Full menu of style options is available for text, background, margin and padding, border, shape and miscellaneous. You can also specify a style class.Object

Scripting​

See the Perspective - Form Scripting page for the full list of scripting functions available for this component.

Examples​

Basic Form Layout with Validation​

This example demonstrates a simple form layout consisting of a single column with multiple input fields, action buttons, and validation rules for required fields.

PropertyValue
props.columns.items[0].rows.items[0].widgets[0].idheader
props.columns.items[0].rows.items[0].widgets[0].label.textSimple Name and Address Entry Form
props.columns.items[0].rows.items[1].widgets[0].idfirstName
props.columns.items[0].rows.items[1].widgets[0].typetext
props.columns.items[0].rows.items[1].widgets[0].text.placeholderEnter your first name...
props.columns.items[0].rows.items[1].widgets[0].label.textFirst Name
props.columns.items[0].rows.items[1].widgets[1].idlastName
props.columns.items[0].rows.items[1].widgets[1].typetext
props.columns.items[0].rows.items[1].widgets[1].text.placeholderEnter your last name...
props.columns.items[0].rows.items[1].widgets[1].label.textLast Name
props.columns.items[0].rows.items[2].widgets[0].idemail
props.columns.items[0].rows.items[2].widgets[0].typeemail
props.columns.items[0].rows.items[2].widgets[0].text.placeholderEnter your email...
props.columns.items[0].rows.items[2].widgets[0].label.textEmail Address
props.columns.items[0].rows.items[2].widgets[0].email.validation.pattern.enabledtrue
props.columns.items[0].rows.items[2].widgets[0].email.validation.pattern.value^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$
props.columns.items[0].rows.items[2].widgets[0].email.validation.required.enabledtrue
props.columns.items[0].rows.items[3].widgets[0].idphoneNumber
props.columns.items[0].rows.items[3].widgets[0].typetel
props.columns.items[0].rows.items[3].widgets[0].text.placeholderEnter your phone number...
props.columns.items[0].rows.items[3].widgets[0].label.textPhone Number
props.columns.items[0].rows.items[3].widgets[0].tel.validation.required.enabledtrue
props.columns.items[0].rows.items[3].widgets[0].tel.validation.pattern.enabledtrue
props.columns.items[0].rows.items[3].widgets[0].tel.validation.pattern.value^\+?[1-9]\d{1,14}$