Search.../

onChange( )

Adds an event handler that runs when a signature input element's value is changed by a site visitor.

Description

A signature input element receives a change event when a site visitor changes its value.

A change event is not triggered when:

  • You, the site owner, change an element's value using the clear() function.
  • The signature input field is empty, and the site visitor clears the signature.

Syntax

function onChange(handler: EventHandler): SignatureInput
handler: function EventHandler(event: Event): void

onChange Parameters

NAME
TYPE
DESCRIPTION
handler

The name of the function to run when the signature input element's value changes.

Returns

The signature input element on which the event is now registered.

Return Type:

EventHandler Parameters

NAME
TYPE
DESCRIPTION
event

The event that occurred.

Returns

This function does not return anything.

Return Type:

void

Was this helpful?

Get the value of the signature input element that was changed

Copy Code
1$w("#mySignatureInputElement").onChange( (event) => {
2 let newValue = event.target.value; // "new value"
3});