Global {#global-v2_Id18AFF0N0A8T}
=================================

Type Definitions {#global-v2_TypeDefinitions}
---------------------------------------------

`callback(erropt, nullable, dataopt, nullable) &gt; {void}`{#global-v2_callbackerroptnullabledataoptnullablevoid}  
Microform uses the error-first callback pattern, as commonly used in [Node.js](https://nodejs.org/api/errors.md#errors_error_first_callbacks "").  
If an error occurs, it is returned by the first `err` argument of the callback. If no error occurs, `err` has a null value and any return data is provided in the second argument.  
***Parameters***

| Name | Type                                                                                                                                                                                                                                             | Attributes                            | Description                                                                                              |
|:-----|:-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:--------------------------------------|:---------------------------------------------------------------------------------------------------------|
| err  | MicroformError. See [Class: MicroformError](/docs/vas/en-us/digital-accept-flex/developer/all/rest/digital-accept-flex/microform-integ-v2/micro-v2-reference/api-reference-v2/class-microform-error-v2.md ""). | \&lt;optional\&gt; \&lt;nullable\&gt; | An Object detailing occurred errors, otherwise null.                                                     |
| data | \*                                                                                                                                                                                                                                               | \&lt;optional\&gt; \&lt;nullable\&gt; | In success scenarios, this is whatever data has been returned by the asynchronous function call, if any. |

**Returns**  
Type: void  
**Example**  
This example shows how to make use of this style of error handling in your code:

```
foo(function (err, data) {
    // check for and handle any errors
    if (err) throw err;

    // otherwise use the data returned
    console.log(data);
});
```

`StylingOptions`  
Styling options are supplied as an object that resembles CSS but is limited to a subset of CSS properties that relate only to the text within the iframe.  
Supported CSS selectors:

* input
* ::placeholder
* :hover
* :focus
* :disabled
* valid
* invalid
* incomplete

Supported CSS properties:

* `color`
* `cursor`
* `font`
* `font-family`
* `font-kerning`
* `font-size`
* `font-size-adjust`
* `font-stretch`
* `font-style`
* `font-variant`
* `font-variant-alternates`
* `font-variant-caps`
* `font-variant-east-asian`
* `font-variant-ligatures`
* `font-variant-numeric`
* `font-weight`
* `incomplete`
* `line-height`
* `opacity`
* `text-shadow`
* `text-rendering`
* `transition`
* `-moz-osx-font-smoothing`
* `-moz-tap-highlight-color`
* `-moz-transition`
* `-o-transition`
* `-webkit-font-smoothing`
* `-webkit-tap-highlight-color`
* `-webkit-transition`

Any unsupported properties will not be applied and will raise a `console.warn()` alert.  
**Properties**

| Name          | Type   | Attributes         | Description                                                                                                                     |
|:--------------|:-------|:-------------------|:--------------------------------------------------------------------------------------------------------------------------------|
| input         | object | \&lt;optional\&gt; | Main styling applied to the input field.                                                                                        |
| ::placeholder | object | \&lt;optional\&gt; | Styles for the ::placeholder pseudo-element within the main input field. This also adds vendor prefixes for supported browsers. |
| :hover        | object | \&lt;optional\&gt; | Styles to apply when the input field is hovered over.                                                                           |
| :focus        | object | \&lt;optional\&gt; | Styles to apply when the input field has focus.                                                                                 |
| :disabled     | object | \&lt;optional\&gt; | Styles applied when the input field has been disabled.                                                                          |
| valid         | object | \&lt;optional\&gt; | Styles applied when Microform detects that the input card number is valid. Relies on card detection being enabled.              |
| invalid       | object | \&lt;optional\&gt; | Styles applied when Microform detects that the input card number is invalid. Relies on card detection being enabled.            |

**Example**

```
const styles = {
	'input': {
		'color': '#464646',
		'font-size': '16px',
		'font-family': 'monospace'
	},
	':hover': {
		'font-style': 'italic'
	},
	'invalid': {
		'color': 'red'
	}
};
```

