Closed pjjroux closed 8 years ago
Although it is not possible to set (easily) any of those when used from Zebra_Form, they still work. Here's how to do it:
In you PHP, after instantiating the library via
$form = new Zebra_Form('myform')
you'd set
$form->clientside_validation(array(
'on_ready' => 'callback',
));
In your JavaScript code have, in the global scope, something like
// i am outside the "document ready" part, in the global scope!
var callback = function() {
// don't forget to change "#your_date_element" to your element's name
var datepicker = $('#your_date_element').data('Zebra_DatePicker');
datepicker.update({
onClose: function() {
alert('close');
},
onChange: function() {
alert('change');
},
onSelect: function() {
alert('select');
}
});
}
$(document).ready(function() {
// your other JavaScript/jQuery code
});
Thank you very much for the assistance
Zebra datepicker only fires on: onBlur and onFocus.
onSelect, onChange, onClose doesn't fire.