I want it to alert "ok" when you change/make a date. But i get two alerts instead of one?
How can i fix this?
here's the code:
$(document).ready(function(){
$('#datePicking').daterangepicker({
arrows:true,
onChange: function(){
alert('ok');
}
});
});
I am using jquery 1.3.2 and UI 1.7.2
It appears that this is known issue with the plugin.
From Scott (Filament) at filamentgroup:
I added a callback function for onChange now that you might be able use. Keep in mind that it may not fit your needs exactly because it will fire on EVERY change that occurs in the input. One-click range shortcuts will actually fire 2 change callbacks because this plugin simply triggers date changes on each datepicker, one at a time. Once this plugin is adopted by jQuery UI, I’m sure we’ll work that part out and have the rangepicker firing events as one widget. For now, you’ll need to set up your page with this issue in mind.
A workaround for this might be to use $('#datePicking').blur()
instead of the onChange
option of the plugin.