In a content type I have various fields including a date field and a time field. Both call their respective callBack.
The problem arises when I try to write the Date via the keyboard and not via the widget. Every time I type a key the callBack is invoked and it's boring
This is the code
              $form['field_data']['widget'][0]['value']['#ajax'] = [
              'event'           => 'change',
              'disable-refocus' => FALSE,
              'callback'        => 'CBDataMiss',
Instead of change it is possible to use onLostFocus or something like that, that is only after leaving the field it calls the callBack, as happens for the autocomplete fields where the event is
'event' => 'autocompleteclose',

Comments

wombatbuddy’s picture

'event' => 'blur',
Gae58’s picture

Perfect thanks, just what I needed