Can anyone tell me how do you trigger the onselect event of datepicker? My code is working well (pulling some data from a database based on the value of datepickers altfield) but when the page loads it doesn't trigger the onselect event on the current date and it doesn't display anything; so I would like to do that manually.
<script>
$( "#datepicker" ).datepicker
(
{
altField: '#sheet',
onSelect: function load() {
$(document).ready(function() {
$.ajax({
type: 'POST',
url: 'test.php',
data: {sheetid: $('#sheet').val()},
success: function(data)
{
$("#content").html(data);
}
});
});
},
firstDay: 1});
</script>
This is the only solution I found that also works for a datetimepicker
var $calendar =$('#from');
$.datepicker._getInst($calendar[0]).settings.onSelect()//or onClose or any event
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