<input type='text' onchange='javascript:alert()' name="mypicker"/>
onchange event is not triggering. I mean, when I change I need to call a function from html tag.
Do you solve the problem yet? I also hit this problem.
Same for me, I wanted to use the options "keepInvalid" and "useStrict" to warn the user instead of overwriting its input, but I failed when trying
$('input[name=mypicker]').on('change', onDateChanged);
BUT there is another event triggered by the datetimepicker : dp.change
So you can do
$('input[name=mypicker]').on('dp.change', onDateChanged);
It doesn't trigger a "real" event though, it's a custom one, but you still can catch it to know the input changed
Hi, I鈥檒l be closing issues that have been answered by the community.
The issue with dp.change versus change is that the former is forcing your code (e.g. validation) to be aware of the date picker used. It's not clear from https://getdatepicker.com/4/Events/#dpchange why the custom event was needed or what are its benefits over the standard change event.
Most helpful comment
Same for me, I wanted to use the options "keepInvalid" and "useStrict" to warn the user instead of overwriting its input, but I failed when trying
BUT there is another event triggered by the datetimepicker :
dp.changeSo you can do
It doesn't trigger a "real" event though, it's a custom one, but you still can catch it to know the input changed