CardInputEventState

The state of an input field at the time a card input event is triggered

Properties

JS
JavaScript

card.addEventListener("cardBrandChanged",  async (cardInputEvent) => {

  const currentInputEventState = cardInputEvent.currentState;

  const previousInputEventState = cardInputEvent.previousState;

  const eventMessage = `Valid input? ${currentInputEventState.isCompletelyValid}

  Was field empty? ${previousInputEventState.isEmpty}`

  alert(eventMessage);

});