For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Resources
Get started
ReferenceGuidesExamplesChangelog
ReferenceGuidesExamplesChangelog
  • Designer API
    • Introduction
    • Getting Started
    • Webflow CLI
    • Error Handling
    • App Modes
  • Elements
    • Creating & Retrieving Elements
    • Element Properties & Methods
    • Element Types & Methods
      • Element Presets
      • DOM Elements
      • Strings
      • Components
      • Slots
      • Headings
      • Images
      • Links
      • Forms
        • Get Form Name
        • Set Form Name
        • Get Form Settings
        • Set Form Settings
        • Form Inputs
  • Styles
    • Managing Style Properties
    • Managing Variable Modes
  • Components
  • Variables & Collections
    • Variable Collections
    • Variables
    • Variable Modes
  • Assets
  • Pages & Folders
  • Utilities
    • User Events & Notifications
    • App Intents & Connections
  • Additional Resources
    • API Playground
    • FAQs
LogoLogo
Resources
Get started
On this page
  • FormForm.setSettings(settings)
  • Syntax
  • Parameters
  • Returns
  • Example
  • Designer Ability
ElementsElement Types & MethodsForms

Set Form Settings

Was this page helpful?
Previous

Form Inputs

Next
Built with

FormForm.setSettings(settings)

Sets the settings of the form.

Syntax

1form.setSettings(
2 settings:{
3 state: {{FORM_STATE}},
4 name: string,
5 redirect: string,
6 action: string,
7 method: {{FORM_METHOD}},
8 }
9): 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