查看文件: member_js.js
大小: 8.17 KB
类型: application/javascript
function checkformread(){ var chk1 = document.getElementById("chkread").checked ; if ( ! chk1 ){ alert("請確認我已了解會員條款..\n") return false; } return true; } function check_m(){ var htel = document.getElementById("htel").value; var ck=true; var s=''; var ckm=false; var ckmid=$("#ckmid").val(); if((htel.length)!=10) { alert('請注意帳號手機號不可低於10個字 ?') ; ckm=false; } else { ckm=true;} if(ckm) { var url = "check_tel_id_code.php"; $.post(url,{"htel":htel}, function(data){ if(data=='Y'){ document.getElementById("chkid").value='Y'; alert('此帳號未被註冊,可以使用..') ; var oDivp = document.getElementById('register_type'); oDivp.style.display= ""; }else{ alert('此帳號已註冊過了,請確認...'); document.getElementById("chkid").value='S'; } }); } // if((memberid.length)!=10) { } } function checkID2( id ) { tab = "ABCDEFGHJKLMNPQRSTUVXYWZIO" ; A1 = new Array (1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3 ); A2 = new Array (0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5 ); Mx = new Array (9,8,7,6,5,4,3,2,1,1); if ( id.length != 10 ) return false; i = tab.indexOf( id.charAt(0) ); if ( i == -1 ) return false; sum = A1[i] + A2[i]*9; for ( i=1; i<10; i++ ) { v = parseInt( id.charAt(i) ); if ( isNaN(v) ) return false; sum = sum + v * Mx[i]; } if ( sum % 10 != 0 ) return false; return true; } function checkform(){ //舊版註冊 var ck=true; var s=''; var mail = new RegExp("^[a-zA-Z0-9\-\.\_]+\@[a-zA-Z0-9\-\.]+(\\.)+([a-zA-Z]{2,4})$","gi"); var username = $("#username").val(); var passwd1 = $("#passwd1").val(); var htel = $('#htel').val(); //var chk2 = $('#chkid').val(); var addr = $('#addr').val(); if(htel.length!=10){ s += '請確認行動電話號碼是否正確 ? \n'; ck =false; } else { if( username =='' ) { s += '姓名請勿空白 ? \n'; ck =false; } if((passwd1.length)<6) { s += '密碼請勿少於6個字 ? \n'; ck =false; } if((addr.length)<6) { s += '住址請勿少於6個字 ? \n'; ck =false; } if(($("#passwd1").val())!=($("#passwd2").val())) { s += '請確認兩次密碼是否正確 ? \n'; ck =false; } if(($("#email").val() == '') || (!mail.test($("#email").val() ))) { s += '電子信箱錯誤 ? \n'; ck =false; } } if(s != '')alert (s); return ck; } function checkform_register() //新版註冊 { var ck=true; var s=''; var mail = new RegExp("^[a-zA-Z0-9\-\.\_]+\@[a-zA-Z0-9\-\.]+(\\.)+([a-zA-Z]{2,4})$","gi"); var username = $("#username").val(); var passwd1 = $("#passwd1").val(); var htel = $('#htel').val(); if(htel.length!=10){ s += '請確認行動電話號碼是否正確 ? \n'; ck =false; } else { if( username =='' ) { s += '姓名請勿空白 ? \n'; ck =false; } if((passwd1.length)<6) { s += '密碼請勿少於6個字 ? \n'; ck =false; } if(($("#passwd1").val())!=($("#passwd2").val())) { s += '請確認兩次密碼是否正確 ? \n'; ck =false; } if(($("#email").val() == '') || (!mail.test($("#email").val() ))) { s += '電子信箱錯誤 ? \n'; ck =false; } } if(s != '')alert (s); return ck; } function zip_change1(s){ var url = "select_zip_code.php"; $.post(url,{"zid":s}, function(data){ document.getElementById("zip_dist").innerHTML=data; }); document.getElementById("addr").value=''; } function zip_change2(s){ var city= document.getElementById("city").value; var url = "select_zip_code2.php"; $.post(url,{"zid":city,"dist":s}, function(data){ document.getElementById("zip_road").innerHTML=data; }); document.getElementById("addr").value=''; } function set_addr(s){ document.getElementById("addr").value=document.getElementById("city").value+document.getElementById("dist").value+s; } function checkid(){ document.getElementById("chkid").value='S'; var oDivp = document.getElementById('member'); oDivp.style.display= "none"; } function btn_register_general(){ var show = document.getElementById('member'); var hidden = document.getElementById('fblogin'); show.style.display= ""; hidden.style.display= "none"; document.getElementById("htel").disabled = false; fb_php_hidden(); fb_disabled_false(); } function btn_register_fb(){ var show = document.getElementById('fblogin'); var hidden = document.getElementById('member'); show.style.display= ""; hidden.style.display= "none"; document.getElementById("htel").disabled = true; fb_php_hidden(); fb_disabled_false(); } function btn_check_fb(){ /*判斷*/ var s=''; var ck=true; var username = $("#fbusername").val(); var passwd1 = $("#fbpasswd1").val(); var htel = $('#htel').val(); var maid = $('#fbmaid').val(); if(htel.length!=10){ s += '請確認行動電話號碼是否正確 ? \n'; ck =false; } else { if( username =='' ) { s += '姓名請勿空白 ? \n'; ck =false; } if((passwd1.length)<6) { s += '密碼請勿少於6個字 ? \n'; ck =false; } if(($("#fbpasswd1").val())!=($("#fbpasswd2").val())) { s += '請確認兩次密碼是否正確 ? \n'; ck =false; } } if(s != ''){ alert (s); }else { fb_disabled_true(); var show = document.getElementById('fblogin_php'); show.style.display= ""; var url = "include/_set_session.php"; $.post(url,{"htel":htel,"username":username,"passwd":passwd1,"maid":maid}, function(data){ $("#fblogin_php").load('include/_fb_login.php'); }); } } function fb_php_hidden() //隱藏FB快速註冊 { var fbhidden = document.getElementById('fblogin_php'); fbhidden.style.display= "none"; } function fb_disabled_true() //檢查後不可修改 { document.getElementById("passwd1").disabled = true; document.getElementById("passwd2").disabled = true; document.getElementById("username").disabled = true; } function fb_disabled_false() //可修改欄位 { document.getElementById("passwd1").disabled = false; document.getElementById("passwd2").disabled = false; document.getElementById("username").disabled = false; fb_php_hidden(); } function check_m2(){ var htel = document.getElementById("htel").value; var ck=true; var s=''; var ckm=false; var ckmid=$("#ckmid").val(); if((htel.length)!=10) { alert('請注意帳號手機號不可低於100個字 ?') ; ckm=false; } else { ckm=true;} if(ckm) { var url = "check_tel_id_code.php"; $.post(url,{"htel":htel}, function(data){ if(data=='Y'){ document.getElementById("chkid").value='Y'; alert('此帳號未被註冊,可以使用..') ; var oDivp = document.getElementById('member'); oDivp.style.display= ""; }else{ alert('此帳號已註冊過了,請確認...'); document.getElementById("chkid").value='S'; } }); } // if((memberid.length)!=10) { } } // window.fbAsyncInit = function() { // FB.init({ // appId : '1814071292251192', // cookie : true, // xfbml : true, // version : 'v2.8' // }); // FB.AppEvents.logPageView(); // }; // (function(d, s, id){ // var js, fjs = d.getElementsByTagName(s)[0]; // if (d.getElementById(id)) {return;} // js = d.createElement(s); js.id = id; // js.src = "//connect.facebook.net/en_US/sdk.js"; // fjs.parentNode.insertBefore(js, fjs); // }(document, 'script', 'facebook-jssdk'));
保存
取消
返回文件列表