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:
Name
|
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:
Events
function findLabel(field) { } findLabel(field).addClass( 'label-float' ).removeClass( 'filled' ); }); var label = findLabel(field); } else { } }); |