I’m using an inline Datepicker with jquery 1.7.2 and jqueryui 1.8.20. the problem I have is that the following doesn’t work until I change the month in the datepicker, then it works fine. Any help would be appreciated.
$( "#datepicker" ).datepicker({
dateFormat: 'D, dd M yy',
minDate:0,
onSelect: function(dateText, inst){
//$('.field_pickDate').html(dateText);
alert('boo');
//console.log(dateText);
}
});
dateFormat and minDate are both working but the onSelect event isn’t firing from the get-go.
This is the default functionality of that event.
Its fired when the user “selects” something in the date picker.
To call an event on click (before you show the date Picker) you can use “beforeShow”.
Here’s a JSFiddle example of it working with your code.
http://jsfiddle.net/applehat/jukJa/1/
You could always just add another event onto the text box, such as
$('#datepicker').select(function(){ /* do something */ });as well, if you want to detect them selecting the field.
================= EDIT ===============
Since you are using it as an Inline element, Im not sure what your problem is. I have updated my JSFiddle here: http://jsfiddle.net/applehat/jukJa/2/
Everything works as expected here, so maybe you have other code causing issues?