function validateSearchResultsForm(searchForm){ var errors = ""; if(isCellActive("departFromCell")){ errors = validateMandatoryDroplist(searchForm["departureLocation.id"], "Departure Point", errors); } errors = validateMandatoryDroplist(searchForm["destinationCountry.id"], "Destination Country", errors); errors = validateMandatorySearchableDroplist(searchForm["destinationCity.id"], "Destination City", errors); if(isCellActive("departDateTextCell")){ if(getPrimaryType()!="FO"){ errors = validateDateGTNow(searchForm["departureDate.year"].value, searchForm["departureDate.month"].value-1, searchForm["departureDate.day"].value, "Departure Date", errors); } else { errors = validateDateEQGTNow(searchForm["departureDate.year"].value, searchForm["departureDate.month"].value-1, searchForm["departureDate.day"].value, "Departure Date", errors); } } else { errors = validateDateGTNow(searchForm["departureDate.year"].value, searchForm["departureDate.month"].value-1, searchForm["departureDate.day"].value, "Check-In Date", errors); } if(isCellActive("returnFlightCell")){ errors = validateDate( searchForm["returnDate.year"].value, searchForm["returnDate.month"].value-1, searchForm["returnDate.day"].value, "Return Date", errors); errors = validateDates( searchForm["departureDate.year"].value, searchForm["departureDate.month"].value-1, searchForm["departureDate.day"].value, 0, 0, "Departure Date", searchForm["returnDate.year"].value, searchForm["returnDate.month"].value-1, searchForm["returnDate.day"].value, 0, 0, "Return Date", errors); } if(isCellActive("durationValueCell")){ errors = validateMandatoryNumberField(searchForm["duration"], "Duration", errors); } if(totalInfants()>totalAdults()){ errors = errors + "Party contains more infants than adults.\n"; } if(errors==""){ return true; } else { alert(errors); return false; } }function validateMandatorySearchableDroplist(droplist, name, errors){ if(droplist.options.length>0 && droplist.value==""){ errors = errors + name + " is required.\n"; } return errors;}