> ## Documentation Index
> Fetch the complete documentation index at: https://docs.slm.m1amdocs.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Understanding onVindiciaFieldEvent

Events happen inside iframes that the parent window is not allowed to respond to. The `onVindiciaFieldEvent` property can be used to call your function when validation events are happening inside the iframes.

```

  onVindiciaFieldEvent: function(event) {
  if (event.detail.fieldType == 'cardNumber') {
  setCardImage(event.detail.cardType); // bright or dim the card logo
  } if (event.detail.fieldType == 'expirationDate') {
  if (!event.detail.isValid)
  {alert('vindiciaFieldEvent expirationDate not valid');
  }
  }
  if (event.detail.fieldType == 'cvn') {
  if (!event.detail.isValid && event.detail.dataLength > 0)
  {
  alert('vindiciaFieldEvent cvn not valid');
  }
  }
  }
```

| `event.detail.fieldType` | `cardNumber`, `expirationDate`, `cvn` or a custom string you provided during setup. - `cardNumber`—validation by Luhn check, forces all numeric characters, returns a `cardType` if detectable. - `expirationDate`—defaults to `mm/yy` format for validation, but you can specify another format. - `cvn`forces all numeric characters. Valid if character count is 3 or 4. |
| - | - |
| `event.detail.cardType` | String property to hold the short name of the card type that was detected. It exists only on events with `fieldType` `cardNumber`. Supported values include: - amex - dankort - diners\_club\_carte\_blanche - diners\_club\_international - discover - jcb - visa\_electron - visa - mastercard - maestro |
| `event.detail.isValid` | Boolean value. If `True`, the data is acceptable and can be submitted. If `False`, the value is illegal or incomplete. |
| `event.detail.dataLength` | This method will return an integer that is a count of characters inside the input box in the iframe. A blank field returns zero. |
| **Parent topic:**[Implementing HOA with Hosted Fields](../topics/Implementing_HOA_with_Ho) | |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.