Let's say I have a #date field. At first I initialize it with some options (they are not important at the moment):
$('#date').datepicker(options);
Then, if I try to add onClose
function, I would do:
$('#date').datepicker({onClose: function(dateText, inst){console.log("Hello World");}});
Howerver, this overrides options set before. Let's say I don't have access to these options - datepicker is initialized, options are set and now I need to add function onClose
. How to do that? I've tried .datepicker('option','onClose',function(){});
with no effect.
An input element that is to be updated with the selected date from the datepicker. Use the altFormat option to change the format of the date within this field.
Simply call . datepicker() on a div instead of an input. (To display the datepicker embedded in the page instead of in an overlay.) Save this answer.
You can set the current date value in DateTimePickerAdv by disabling the IsNullDate property and set the DateTimePickerAdv value as current date.
Try it as
$('#date').datepicker( 'option' , 'onClose', function() {} );
Try this:
$('#date').datepicker();
...
$('#date').datepicker("option", {
onClose: function(dateText, inst){console.log("Hello World");}
});
Of course this would override the previous onClose function you've set before. source: jQuery forum post
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