Event listeners - blur, focus

Hi,
I cannot attach an event listener to listen on blur, or focus :frowning:
I have got 'click' or 'change' working.
Can you help me?
Steve

Dear @Stepan,
Depends on the field type, but you can add an event listener to the input of field, for example:

var elem = $(fd.field('Title').$el).find('input');
elem.bind("focus", function(event){
  console.log("Focus value: " + fd.field('Title').value);
});
elem.bind("blur", function(event){
  console.log("Blur value: " + fd.field('Title').value);
});

This would work for some field types, but not all.

1 Like