Skip to main content
You can call the addEventListener on a Secure Fields instance or on fields, passing one of the supported events and a callback. removeEventListener removes a previously attached event handler.

Global events

The following events can be listened to by attaching an event handler to the SecureFields instance using the addEventListener method.

Field events

The following events can be listened to by attaching an event handler to a field (returned by the addCardNumberField, addExpiryDateField, addSecurityCodeField and addField methods) using the addEventListener method. Some of these provide additional useful data like the card BIN, validation status, and scheme. For example, the input event on a card number field might include { schema: 'visa', codeLabel: 'CVV', valid: true, ... }.