materialize-clockpicker
materialize-clockpicker copied to clipboard
jquery `on change` isn't triggered - trying to validate input
My HTML:
<input id="start_time" type="time">
My jquery script:
$('#start_time').pickatime({
autoclose: false,
twelvehour: true
});
And this is only triggered when I select the time for the first time:
$(document).on('change','#start_time',function(){
console.log('changed');
});
When I change the time to something else changed
is not logged to console.
Am I missing something basic here or is this a desired behaviour? How do I proceed with checking if the time has changed?
Try this...
$('#start_time').change(function() { console.log('changed'); });
Nope still nothing. Let me try to create jsfiddle. Update: I tried and I failed: https://jsfiddle.net/ab7zLdxu/1/
ps
Regarding my example in first post. I have multiple different input elements on which the code above $(document).on()
works nicely. It's just the timepicker that doesn't register the change.