FormForm.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

1form.getSettings(): Promise<FormSettings>

Returns

Promise<FormSettings>: Object - A promise that resolves to the settings of 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’)

Example

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

Designer Ability

Designer AbilityLocaleBranchWorkflowSitemode
canAccessCanvasAnyAnyAnyAny
</rewritten_file>
Built with