hope this will help you function DateComparison(){ var startDate; var endDate; startDate = document.formName.txtStartDate.value; endDate = document.formName.txtEndDate.value; var stYear, enYear, stMonth, enMonth, stDay, enDay; stYear = startDate.substring(6,10); enYear = endDate.substring(6,10); stMonth = startDate.substring(3,5); enMonth = endDate.substring(3,5); stDay = startDate.substring(0,2); enDay = endDate.substring(0,2); if (stYear > enYear) { return false; } else if (stYear == enYear) { if (stMonth > enMonth) { return false; } else if (stMonth == enMonth) { if (stDay > enDay) { return false; } } } return true; } Regards John