function resetForm() { $('#WFForm').find(":text").each(function() { $(this).val(""); }); var selects = document.getElementsByTagName("select"); $.each(selects, function () { $(this).val("00"); }); $("#msg").val(""); $("#statusMsg").val(""); $("#actionMsg").val(""); $(":checkbox").removeAttr('checked'); $('#window').html(""); //清除顯示案號 $("#DIV_CASE_NO").hide(); $("#P_CASE_NO").text(""); //清空驗證碼提示 if ( $( "#needCaptcha" ).length ) { $("#needCaptcha").hide(); } //清空驗證碼提示 if ( $( "#errorCaptcha" ).length ) { $("#errorCaptcha").hide(); } } function doReport(actionName, codeType) { $('#codeType').val(codeType); var rwin = window.open('','openWin','width=900,height=620,left=50,top=50,resizable=1,scrollbars=1'); document.WFForm.action = actionName; document.WFForm.target='openWin'; document.WFForm.submit(); rwin.focus(); } function Change(){ if( $('#type').val() == '0' ){ $("#APL_NAME").hide(); $("#DECL_NO").hide(); $("#CASE_NO").hide(); $("#APL_NAME").val(''); $("#DECL_NO").val(''); $("#CASE_NO").val(''); }else if( $('#type').val() == '1' ){ $("#APL_NAME").show(); $("#DECL_NO").hide(); $("#CASE_NO").hide(); $("#DECL_NO").val(''); $("#CASE_NO").val(''); } else if( $('#type').val() == '2' ){ $("#APL_NAME").hide(); $("#DECL_NO").show(); $("#CASE_NO").hide(); $("#APL_NAME").val(''); $("#CASE_NO").val(''); }else if( $('#type').val() == '3' ){ $("#APL_NAME").hide(); $("#DECL_NO").hide(); $("#CASE_NO").show(); $("#APL_NAME").val(''); $("#DECL_NO").val(''); } } function validationIdNo(aplId){ var firstValue = FirstMapByIdNo()[aplId.substring(0,1)]; aplId = validationIdNo_Step1(firstValue,aplId); var lastNum = parseInt(aplId.substring(aplId.length-1,aplId.length)); if(lastNum != 0){ if(10==validationIdNo_Step2(aplId)){ return true; }else{ return false; } }else{ if(0==validationIdNo_Step2(aplId)){ return true; }else{ return false; } } } function validationIdNo_Step1(firstValue,aplId){ var x = parseInt(firstValue/10); var y = (firstValue%10)*9 ; aplId = aplId.replace(aplId.substring(0,1),(x+y)%10); return aplId ; } function validationIdNo_Step2(aplId){ var a = [1,8,7,6,5,4,3,2,1]; var sum=0; for(var i=0;i