function aptis_finish_do(no) { location.href='aptis_order_detail.php?no='+no; } function aptis_select_exam(obj) { school_id = obj.value; aptis_select_exam_core(school_id); } function aptis_select_exam_core(school_id) { $.post("ajax_function/aptis_select_exam.php", { school_id:school_id }, function(data) { if(data!="") { console.log(data); // aExam = eval("(" + data + ")"); aExam = JSON.parse(data); console.log(aExam); // console.log(aExam); aptis_select_exam_add_obj(aExam); } } ); } //data= {"s10":"10str","s2":"2str"}; //console.log(data); function aptis_select_exam_add_obj(aExam) { exam_obj = document.getElementById("aptis_type3"); exam_obj.options[0] = new Option("Select Exam", ""); i =0; for(i=0;i< aExam.length;i++ ) { rExam = aExam[i]; exam_id = rExam["no"]; title = rExam["title"]; console.log(exam_id); console.log(title); exam_obj.options[i+1] = new Option(title,exam_id); } exam_obj.length = i+1; } function aptis_step2_back() { location.href="step1.php"; } function aptis_step3_back() { location.href="aptis_step2.php"; } function aptis_step2_do() { if(document.getElementById("cn_family_name").value=="") { alert("Please input 'Chinese Family Name'!"); document.getElementById("cn_family_name").focus(); return false; } if(document.getElementById("cn_given_name").value=="") { alert("please input 'Chinese Given Name'!"); document.getElementById("cn_given_name").focus(); return false; } if(document.getElementById("en_family_name").value=="") { alert("please input 'English Family Name'!"); document.getElementById("en_family_name").focus(); return false; } if(document.getElementById("en_given_name").value=="") { alert("please input 'English Given Name' !"); document.getElementById("en_given_name").focus(); return false; } if(document.getElementById("passport").value=="") { alert("please input 'Passport/National ID' !"); document.getElementById("passport").focus(); return false; } if(document.getElementById("birthday3").value=="") { alert("你沒有選擇出生日!"); document.getElementById("birthday3").focus(); return false; } if(document.getElementById("birthday2").value=="") { alert("你沒有選擇出生月!"); document.getElementById("birthday2").focus(); return false; } if(document.getElementById("birthday1").value=="") { alert("你沒有選擇出生年!"); document.getElementById("birthday1").focus(); return false; } if(false ==getSelectValue("sex","radio")) { alert("你沒有選擇性別!"); return false; } if(false ==checkMobileByModify("mobile",old_mobile)) { return false; } if(false ==checkTelephoneByModify("telephone",old_telephone)) { return false; } if(false ==checkAddressByModify("live_address",old_address)) { return false; } if("Y" == is_empty_exam_date ) { if(document.getElementById("exam_date").value=="") { alert("你沒有選擇考試日期!"); document.getElementById("exam_date").focus(); return false; } if( isBlank("exam_date")==false && isDate(document.getElementById("exam_date").value )==false) { alert('"考試日期"欄位只接受日期(2001-01-02),請正確輸入!'); document.register.exam_date.focus(); return false; } } update_modify_aptis_order_input(); document.getElementById("form_register").submit(); return true; } function update_modify_aptis_order_input() { if(document.getElementById("telephone2").value!=old_telephone) { document.getElementById("is_modify_telephone").value="1"; } if(document.getElementById("mobile").value!=old_mobile) { document.getElementById("is_modify_mobile").value="1"; } if(document.getElementById("live_address").value!=old_address) { document.getElementById("is_modify_address").value="1"; } } function under18text(obj) { if(obj.checked==true) { document.getElementById("under18_div").style.display="block"; } else { document.getElementById("under18_div").style.display="none"; } } function aptis_step3_do() { check = document.getElementById("agreement1").checked; if(check ==false) { alert("please agree the declaration!"); document.getElementById("agreement1").focus(); return false; } document.getElementById("form_register").submit(); }