Search.../

addControl( )

Adds an input control to the draft form.

Admin Method

This function requires elevated permissions to run. This function is not universal and runs only on the backend.

Syntax

function addControl(eventId: string, options: AddControlOptions): Promise<AddControlResponse>

addControl Parameters

NAME
TYPE
DESCRIPTION
eventId
string

Event ID to which the form belongs.

options
Optional
AddControlOptions

Optional fields.

Returns

Return Type:

Promise<
AddControlResponse
>
NAME
TYPE
DESCRIPTION
_id
string

Generated unique input control ID.

form
Form

Modified draft event form.

Was this helpful?

addControl example

Copy Code
1import { forms } from 'wix-events.v2';
2
3 async function addControl(eventId, options) {
4 try {
5 const result = await forms.addControl(eventId, options);
6
7 return result;
8 } catch (error) {
9 console.error(error);
10 // Handle the error
11 }
12 }
13