> ## 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.

# Vindicia Object Properties and Methods

The following properties are supported.

| vindicia.setup | The heart of the Hosted Fields system. Calling this function takes over the submit event and creates iframes on your checkout page. Each iframe represents a single input field, such as credit card number, expiration date, CVN. |
| - | - |
| vindicia.cardType | String property to hold the short name of the card type that was detected. Supported values include the following: - amex - dankort - diners\_club\_carte\_blanche - diners\_club\_international - discover - jcb - visa\_electron - visa - mastercard - maestro |
| vindicia.dataLength(selector) | This method returns an integer that is a count of characters inside the input box in the iframe. If no selector is specified or if the selector cannot find the iframe, it returns zero. This the following is useful for detecting whether the number entered is an Amex card, and whether four numbers were entered in the CVV field: `if (vindicia.cardType == "amex" && vindicia.dataLength('vin_PaymentMethod_nameValues_cvn') != 4) &#123; alert("American Express CVV must be 4 numbers"); return false &#125;` |
| vindicia.isValid(selector) | This method returns a boolean value that represents whether or not the input box in the iframe is valid. If no selector is specified, the method checks all the iframe input boxes and returns true if all are valid, false if at least one is not valid. `if (!vindicia.isValid('vin_PaymentMethod_creditCard_account')) &#123; alert('Please enter a valid credit card before submitting'); &#125;` |
| vindicia.isSynced() | This method returns `True` if all the iframes have reported their data to the master iframe. This method will return `False` if at least one iframe has not reported its data. Reporting is triggered by an `onblur` or `onchange` event. This method was added to help work around a Mobile Safari bug (still extant as of this writing) in which blur events are not consistently being triggered. |
| vindicia.clearSyncFlags() | This method sets all iframe sync values to `False`. It is typically called just before `syncData()`. You can also use this method on `vindicia.submit()` to ensure that changes in the form fields are captured. |
| vindicia.syncData() | This method sends a message to each iframe to simulate a blur event. This causes each iframe to validate its form data, send its results to the master iframe, and notify the parent window for validation purposes. This method is provided to help you work around a Mobile Safari bug (still extant as of this writing) in which blur events are not consistently being triggered. This method is called every 300ms, when on Mobile Safari devices, to ensure that blur events are triggered. See also: `noSafariMobileTimer()`, `isSynced()`, and `clearSyncFlags()`. You can also use this method on `vindicia.submit()` to ensure that changes in form fields are captured. `setInterval(function() &#123; vindicia.syncData(); &#125;,300);` |
| vindicia.clearData() | This method clears the data in the iframes input boxes and drop-down boxes. It also clears the `sync` flags and `isValid` flags, and set `isComplete()` to `False`. |
| vindicia.resetCompleteStatus() | This method sets `isComplete()` to `False`, allowing the submit button to initiate another POST. This is useful in single page Apps when you do not want to call `clearData()`. |
| vindicia.submit() | This method causes all iframes to submit their data directly to Vindicia.com, provided their data is valid. Not required for normal operation. |
| **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.