Class: FormContainer

FormView~ FormContainer

Represents a FormContainer class.


new FormContainer(params)

Creates an instance of the FormContainer class.

Parameters:
Name Type Description
params object

The parameters for constructing the FormContainer instance.

Methods


()

Prevents the default behavior of the Enter key on text input components within the formContainer from triggering a form submission and redirecting to the Thank-You Page. Preserves accessibility by allowing Enter key to work normally on interactive elements.


addInstanceManager(instanceManager)

Adds an instance manager view to the fields of the formContainer.

Parameters:
Name Type Description
instanceManager object

The instance manager view to be added.


getField(fieldId)

Returns the form field view with the specified field ID.

Parameters:
Name Type Description
fieldId string

The ID of the form field.

Returns:

The form field view, or null if not found.

Type
object | null

getModel( [id])

Returns the model with the specified ID. If no ID is provided, returns the entire model.

Parameters:
Name Type Argument Description
id string <optional>

The ID of the model element.

Returns:

The model element or the entire model.

Type
object

getLang()

Returns the language code of the form.

Returns:

The language code (e.g., "en").

Type
string

getParentFormElementId(model)

Returns the ID of the form element's parent in the HTML structure.

Parameters:
Name Type Description
model object

The form element model.

Returns:

The parent ID.

Type
string

addField(fieldView)

Adds a field view to the form container.

Parameters:
Name Type Description
fieldView object

The field view to be added.


setFocus(id)

Sets the focus on the specified field ID.

Parameters:
Name Type Description
id string

The ID of the field to set the focus on.


getFormId()

Returns the ID of the form.

Returns:

The form ID.

Type
string

getFormTitle()

Returns the title of the form.

Returns:

The form title.

Type
string

getPath()

Returns the path of the form container.

Returns:

The form container path.

Type
string

getFormElement()

Returns the form element associated with the form container.

Returns:

The form element.

Type
HTMLElement

getAllFields()

Returns all fields of the form container.

Returns:

An object containing all fields of the form container.

Type
object

updateActiveChild(activeChild)

Updates the active child of the form container.

Parameters:
Name Type Description
activeChild Object

The active child.


subscribe()

Subscribes to model changes and updates the corresponding properties in the view.