A
A
artem782017-02-10 17:50:31
JavaScript
artem78, 2017-02-10 17:50:31

Why does the onClose event in the jquery datetimepicker plugin happen multiple times?

Put on the page two fields with datetimepicker th. Added a handler to the onClose event. Why does the event also occur when the form is opened and moreover 3 times? Is this a bug?

$(document).ready(function() {
  $.datetimepicker.setLocale('ru');
  var opts = {
    format: 'd.m.Y H:i',
    allowBlank: true,
    timepickerScrollbar: false,
    onClose: on_change
  };
  $('#date1').datetimepicker(opts);
  $('#date2').datetimepicker(opts);
});


function on_change() {
  alert('changed!');
}


https://jsfiddle.net/crazzy/bsek2k52/

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question