I have the following scenario:
In my masterpage I have:
$(".datepicker").datepicker({
changeYear: true,
changeMonth: true,
dateFormat: "dd/mm/yy",
duration: 'fast'
});
With this, every input field that I assign the class "datepicker" to, shows the jQuery UI datepicker when clicked.
Now I have a datepicker on a page that should have its onSelect
event handled. What would be the way considered best practise to do this?
Options I see:
datepickerWithSelectEvent
. What I dont like about this solution is that I get duplicate code for initializing the changeYear
, changeMonth
, ... . If I want to change the datepickers in a project I'll have to remember changing this in 2 placesHave you tried:
$(".datepickerSelect").datepicker( 'option' , 'onSelect', function() {} );
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With