FormForm.setSettings(settings)

Sets the settings of the form.

Syntax

1form.setSettings(settings: Partial<FormSettings>): Promise<null>

Parameters

  • settings: Partial<FormSettings> - The settings to set for the form.

FormSettings Properties

PropertyTypeDescription
stateFormStateThe current state of the form (‘normal’, ‘success’, or ‘error’)
namestringThe name of the form
redirectstringThe URL to redirect to after form submission
actionstringThe URL where the form data will be submitted
methodFormMethodThe HTTP method used for form submission (‘get’ or ‘post’)

Returns

Promise<null>

A Promise that resolves to null.

Example

1const selectedElement = await webflow.getSelectedElement()
2
3if (selectedElement?.type === 'FormForm' || selectedElement?.type === 'FormWrapper'){
4
5 await selectedElement.setSettings({
6 state: "success",
7 name: "My Form",
8 redirect: "https://www.my-site.com/thank-you",
9 action: "https://{dc}.api.mailchimp.com/3.0/lists/{list_id}/members",
10 method: "post"
11 })
12
13} else {
14 console.log("Selected Element is not a Form Element")
15}

Designer Ability

Designer AbilityLocaleBranchWorkflowSitemode
canEditAnyAnycanvasAny
Built with