Get input type

formInput.getInputType()

Retrieves the HTML type of a FormTextInput field.

Supported element:

  • FormTextInput

Syntax

1formInput.getInputType(): Promise<'text' | 'email' | 'password' | 'tel' | 'number' | 'url' | null>;

Returns

A Promise resolving to a string or null

Returns the HTML type of the FormTextInput element ('text', 'email', etc.). Returns null if the type is not found.

Example

1// Get the currently selected element
2let formTextInput = await webflow.getSelectedElement();
3
4// Get the input type
5let type = await formTextInput.getInputType();
6
7console.log(type); // e.g., "email"

Designer ability

Designer AbilityLocaleBranchWorkflowSitemode
canAccessCanvasAnyAnyAnyAny