So basically guys, the datepicker is connected to three fields (drop downs for..) [Month]/[Day]/[Year]-[Datepicker(Calendar)] now I just wanted to get the dropdowns' values and pass it on a textbox (namely: selectedDate - you can see below) having a format of [[U]mm/dd/yyy[/U]] thanks for the help experts.
Code from http://keith-wood.name/datepick.html
// Update three select controls to match a datepicker selection
function updateSelected(dates) {
$('#selectedMonth').val(dates.length ? dates[0].getMonth() + 1 : '');
$('#selectedDay').val(dates.length ? dates[0].getDate() : '');
$('#selectedYear').val(dates.length ? dates[0].getFullYear() : '');
checkLinkedDays(); // Disable invalid days
}
$('#selectedPicker').datepick({
minDate: '01/01/2001', maxDate: '12/31/2010',
alignment: 'bottomRight', onSelect: updateSelected,
showTrigger: '#calImg'});
// Update datepicker from three select controls
$('#selectedMonth,#selectedDay,#selectedYear').change(function() {
$('#selectedPicker').datepick('setDate', new Date(
$('#selectedYear').val(), $('#selectedMonth').val() - 1,
$('#selectedDay').val()));
});
The Dropdowns:
<body>
<form id = "list">
<select id = 'selectedMonth' name = 'selectedMonth'>
</select>
<select id = 'selectedDay' name = 'selectedDay'>
</select>
<select id = 'selectedYear' name = 'selectedYear'>
</select>
<input type="hidden" size="10" id = "selectedPicker"/>
<div style="display:none"><img src="amazingcalendar.jpg" width="16" height="15" id = "calImg"/></div>
<input type="text" size="10" id = "selectedDate"/>
</form>
</body>