function checkMandatoryFlyDrive(fieldName,error,componentId) { if ((jQuery("#"+fieldName).val() == "") || (jQuery("#"+fieldName).val() == 'dd/mm/yy')) { jQuery("#labelErrorMsgCar_"+componentId).text(error); jQuery("#"+fieldName).focus(); return true; } return false; } function doFlyDriveSubmit(componentId) { if (checkMandatoryFlyDrive("flyCheckInDate_"+componentId,'Departure date is a mandatory field',componentId)) return; if (checkMandatoryFlyDrive("flyCheckOutDate_"+componentId,'Arrive date is a mandatory field',componentId)) return; if (!checkFromToDate("flyCheckInDate_"+componentId, "flyCheckOutDate_"+componentId,'Return date must be after depart date', "labelErrorMsgCar_"+componentId)) return; jQuery("#searchBtn").attr("disabled","true"); var message = "Package to-" + jQuery("#flyDest_"+componentId).val() + " " + atDateMsg + " "+ jQuery("#flyCheckInDate_"+componentId).val(); jQuery("#loadingDiv").text(message); if(jQuery("#popupTextChange").length > 0) setPopupText(jQuery("#flyCheckInDate_"+componentId).val(), jQuery("#flyCheckOutDate_"+componentId).val(), '',jQuery("#flyDest_"+componentId).val(),'FlyDrive') $(".loadPopup").bPopup(); navigateToUrl("/SearchFlyDrive.do" , "SearchFlyDrive_" + componentId , "compareList=&"); // focus on loading pop-up for accessibility issues jQuery("#popupLoader").focus(); } $(document).ready(function() { // when in keyboard mode - eliminate calender pop up if (isKeyboard()) { // we are in accessibility mode jQuery("#flyCheckInDate_" + compId).attr("value", "dd/mm/yy") jQuery("#flyCheckInDate_" + compId).removeClass("calenderSearchTrigger") jQuery("#flyCheckInDate_" + compId).unbind("") jQuery("#flyCheckOutDate_" + compId).attr("value", "dd/mm/yy") jQuery("#flyCheckOutDate_" + compId).removeClass("calenderSearchTrigger") jQuery("#flyCheckOutDate_" + compId).unbind("") } else { // we are in regular mode - no accessibility issues } });