KR.onFocus()
Description
KR.onFocus() allows you to be notified when a form field takes focus.
Example of integration
https://github.com/lyra/rest-php-examples/blob/master/www/js_examples/jquery/minimalEmbeddedForm.onFocus.php#L70-L78
<script type="text/javascript"> $(document).ready(function() { KR.onFocus( function(event) { var myMessage = "focus on: " + event.field; $("#custommessage").html(myMessage); }); }); </script>
If the card number field is in focus, the event variable will take the following value:
{ "field":"pan", "formId":"F73867", "_type":"krypton/focus" }
You can also use KR.onBlur() to detect the loss of focus of a field. Its operation is similar to KR.onFocus()