How to call a function on the Finish button in jquery time picker

I have a jquery time selector on my page. I want to call a function at this timepicker when the DONE button is pressed. so how to do it?

Please help me.

+4
source share
2 answers

Yu should do it onClose

$('#example16_end').datetimepicker({ onClose: function(dateText, inst) { alert('closing'); }, 
+4
source

You can associate the click event with the "Done" button in a previous datepicker callback like this ...

  $( "#datepicker" ).datepicker({ showButtonPanel: true, beforeShow: function (input) { setTimeout(function () { var btn = $(input).datepicker("widget").find(".ui-datepicker-buttonpane .ui-datepicker-close"); btn.bind("click", function () { $(input).datepicker( "setDate", new Date() ); $(input).datepicker( "hide" ); }); }, 1); } }); 

This will work.

+1
source

Source: https://habr.com/ru/post/1401782/


All Articles