formInput.getName()

Retrieves the name of the input field.

This method supports the following FormInput elements:

  • FormCheckboxInput
  • FormFileUploadWrapper
  • FormRadioInput
  • FormSelect
  • FormTextarea
  • FormTextInput

Syntax

1formInput.getName(): Promise<string>;

Returns

A Promise that resolves to a string

The name of the input field.

Example

1// Get the currently selected element
2let formInput = await Webflow.getSelectedElement();
3
4// Get the name of the input field
5let name = await formInput.getName();
6
7console.log(name);

Designer ability

Designer AbilityLocaleBranchWorkflowSitemode
canAccessCanvasAnyAnyAnyAny
Built with