Global

Type Definitions

callback(erropt, nullable, dataopt, nullable) > {void}
Microform uses the error-first callback pattern, as commonly used in Node.js.
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.
<optional> <nullable>
An Object detailing occurred errors, otherwise null.
data
*
<optional> <nullable>
In success scenarios, this is whatever data has been returned by the asynchronous function call, if any.
Returns
Type: void
Example
The following 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
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
  • 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 raise a 
console.warn()
.
Properties
Name
Type
Attributes
Description
input
object
<optional>
Main styling applied to the input field.
::placeholder
object
<optional>
Styles for the ::placeholder pseudo-element within the main input field. This also adds vendor prefixes for supported browsers.
:hover
object
<optional>
Styles to apply when the input field is hovered over.
:focus
object
<optional>
Styles to apply when the input field has focus.
:disabled
object
<optional>
Styles applied when the input field has been disabled.
valid
object
<optional>
Styles applied when Microform detects that the input card number is valid. Relies on card detection being enabled.
invalid
object
<optional>
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' } };