If I did not select a date in an input field containing a date selection calendar, the calendar.getFormatedDate() function returns the day’s date. How can I find out if there was a date selected? Is there a function that returns an empty string or null if no date was selected?
You may set onClick event handler that is called when date is selected in calendar.
[code]var selectedDate;
myCalendar.attachEvent(“onClick”,function(date){
selectedDate = date;
})
function getDate(){
var date = myCalendar.getDate();
var isSelectedDate = (date.valueOf()==selectedDate.valueof());
return [myCalendar.getFormatedDate(),isSelectedDate];
}[/code]