Closed danielocdh closed 11 years ago
Use this:
jQuery(function($){
$('.mydate').datepicker('option', 'onSelect', function(){
var $this = $(this);
alert($this.datepicker('getDate'));
$this.removeClass('watermark'); // you can leave this out if you're not using watermarks
});
});
Let me know if this works for you.
Thank you this will work for me now but, it probably only works if my code is after the plugin code not before, isn't this a jquery ui bug anyway?
No, it's not a jQuery UI bug, it seems the default onSelect triggers the change event and since I've already overridden it it will not fire.
Maybe I'll add a $(this).trigger('change');
to keep things under control and support expected behavior.
About the order, that's normal... your code basically needs to be evaluated after so it overrides the plugin's override of onSelect :)
On the last commit you added this: function generate_code, datepicker.php
I had a working external js that used the ".mydate" on other places, it is not working now. Something like this: