For a working demo, please click here :] http://jsfiddle.net/gvAbv/13/ or http://jsfiddle.net/gvAbv/8/
In the demo, click on the text box and select the dates and bingo, you will get automatic completion.
A point for notes dateText.split('/')[2]is not a day a year :) if you switch the place where your code will work.
. dateText.split('/')[2]: ; dateText.split('/')[0]: ; dateText.split('/')[0]: .
, !
$(function() {
$("#fullDate").datepicker({
onClose: function(dateText, inst) {
$('#year').val(dateText.split('/')[2]);
$('#month').val(dateText.split('/')[0]);
$('#day').val(dateText.split('/')[1]);
}
});
});
http://jsfiddle.net/zwwY7/
$(function() {
$("#fullDate").datepicker({
buttonImage: 'icon_star.jpg',
buttonImageOnly: true,
onClose: function(dateText, inst) {
$('#year').val(dateText.split('/')[2]);
$('#month').val(dateText.split('/')[0]);
$('#day').val(dateText.split('/')[1]);
}
});
});

