| [ Web Proxy ] |
| Viewing: https://developer.squareup.com/reference/sdks/web/payments/objects/CardInputEventState | [Back] [Original] |
Objects
An error style class is applied to the input field due to an input error
The input field has been selected
The SDK has validated the input field contents
The input field is empty
The input value is not empty and is being validated
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);
});| Web Proxy Viewer | New URL | Original Page |