Get input name

formInput.getName()

Retrieves the name of the input field.

This method supports the following FormInput elements:

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

Syntax

formInput.getName(): Promise<string>;

Returns

A Promise that resolves to a string

The name of the input field.

Example

// Get the currently selected element
let formInput = await Webflow.getSelectedElement();
// Get the name of the input field
let name = await formInput.getName();
console.log(name);

Designer ability

Designer AbilityLocaleBranchWorkflowSitemode
canAccessCanvasAnyAnyAnyAny