function optionGrab(theElement){return theElement.options[theElement.selectedIndex].value;} function optionAssign(theElement, assignValue){for (optionIndex=0; optionIndex<theElement.length; optionIndex++){if (theElement.options[optionIndex].value==assignValue){theElement.options[optionIndex].checked=true;break;}}} function ChkField(theForm){rFlag=theForm.RtnFlag.checked;rDate=optionGrab(theForm.RtnDate);rTime=optionGrab(theForm.RtnTime);if (document.domain){var sDomain = document.domain;sDomain = sDomain.toLowerCase();if ((sDomain!="ticket.ezfly.com")&&(sDomain!="ticket-v.ezfly.com")){ }}if (rFlag) {if (rDate == 0){alert("請選擇 \"回程日期\" !");return false;}if(rTime == 0){alert("請選擇 \"回程時段\" !");return false;}if (document.new_ticket.RtnDate.selectedIndex < document.new_ticket.DepDate.selectedIndex+1){DateTimeCheck = confirm("您訂購的回程日期早於去程日期,\n確定您的行程無誤?");if (DateTimeCheck == false){return false;}} RtnDateV = document.new_ticket.RtnDate.value;DepDateV = document.new_ticket.DepDate.value; RtnTimeV = document.new_ticket.RtnTime.value; DepTimeV = document.new_ticket.DepTime.value; if (RtnDateV == DepDateV && RtnTimeV < DepTimeV) { DateTimeCheck = confirm("您訂購的回程時間早於去程時間,\n確定您的行程無誤?"); if (DateTimeCheck == false) { return false; } } return true; } else { if(rDate != 0 || rTime !=0) { alert("請勾選 \"我要訂回程\" !"); return false; } } return true; } function checkDepRtn(){ if (document.new_ticket.RtnFlag.checked == true){ if (document.new_ticket.RtnDate.selectedIndex < document.new_ticket.DepDate.selectedIndex+1) { document.new_ticket.RtnDate.selectedIndex = document.new_ticket.DepDate.selectedIndex+1; document.new_ticket.RtnTime.selectedIndex = document.new_ticket.DepTime.selectedIndex+1; } } else { document.new_ticket.RtnDate.selectedIndex = 0; document.new_ticket.RtnTime.selectedIndex = 0; } }