1. Home
  2. Interswitch lending Service
  3. Value Financing
  4. Tokenization Using Hosted Fields
  5. Tokenization Event

Tokenization Event

There are available events emitted by the hosted field instance that you can subscribe to. This can be done on the hostedField instance.

These events include:

Event Description
focus This event is emitted when a field gains focus
blur This is emitted when a field loses focus
validityChange This is emitted when the validity of a field changes
empty This is emitted when the field becomes empty


Register the events using the on method on the hostedFieldInstance returned.

See below an example using the focus and blur event:

function findLabel(field)
    return $('.hosted-field--label[for="' field.container.id + '"]');
hostedFieldInstance.on('focus'function (event) {
   var field = event.fields[event.emittedBy];
hostedFieldInstance.on('blur'function (event) {
   var field = event.fields[event.emittedBy];
   var label = findLabel(field);
   if (field.isEmpty) {
    else if (field.isValid) {
    else {


Was this article helpful to you? Yes No

How can we help?