Forms
Webflow Forms enable users to capture and collect information from visitors on a site. Forms are essential for gathering user data, feedback, and enabling key interactions.
Form structure
A Webflow form consists of several nested elements that work together:
The methods documented below apply specifically to the FormForm
and FormWrapper
elements. For more information about creating and styling forms, see the Forms lesson in Webflow University.
Properties
Methods
FormForm
and FormWrapper
elements.form.getName()
Retrieves the name of the form.
Syntax
Returns
Promise<name
>: String - The name of the form.
Example
Designer Ability
form.setName(name: string)
Sets the name of the form.
Syntax
Parameters
name
: String - The name of the form.
Returns
Promise<null
>
A Promise that resolves to null
.
Example
Designer Ability
form.getSettings()
Retrieves the settings of the form.
To get the settings of the form in a specific state, first use the form.setSettings()
method to set form to the desired state
. Then use form.getSettings()
to retrieve the settings of the form.
Syntax
Returns
Promise<FormSettings
>: Object - A promise that resolves to the settings of the form.
FormSettings
Properties
Example
Designer Ability
form.setSettings(settings: FormSettings)
Sets the settings of the form.
Syntax
Parameters
settings
: Partial<FormSettings
> - The settings to set for the form.
FormSettings
Properties
Returns
Promise<null
>
A Promise that resolves to null
.
Example
Designer Ability
formInput.getRequired()
Retrieves the required status of a form input.
This method is applicable to the following form input types:
FormCheckboxInput
FormFileUploadWrapper
FormRadioInput
FormSelect
FormTextarea
FormTextInput
Syntax
Returns
Promise<boolean
>: Boolean - A promise that resolves to the required status of the form input.
Example
Designer Ability
formInput.setRequired(required: boolean)
Sets the required status of a form input.
This method is applicable to the following form input types:
FormCheckboxInput
FormFileUploadWrapper
FormRadioInput
FormSelect
FormTextarea
FormTextInput
Syntax
Parameters
value
: Boolean - The required status of the form input.
Returns
Promise<null
>
A Promise that resolves to null
.