$('#btnSearchId, #btnSearchPwd').on('click', function(){ var f = document.findForm; var oid = $(this).attr('id'); if(oid == 'btnSearchId'){ if(!f.idName.value){ alertMsg(f.idName, '이름을 입력하세요.'); return; } if(!f.idTel.value){ alertMsg(f.idTel, '핸드폰 번호를 입력하세요.'); return; } if(!checkMobile(f.idTel.value)){ alertMsg(f.idTel, '핸드폰 번호 형식이 올바르지 않습니다.'); return; } f.actMode.value = "1"; }else{ if(!f.pwId.value){ alertMsg(f.pwId, '아이디를 입력하세요.'); return; } if(!f.pwName.value){ alertMsg(f.pwName, '이름을 입력하세요.'); return; } if(!f.pwTel.value){ alertMsg(f.pwTel, '핸드폰 번호를 입력하세요.'); return; } if(!checkMobile(f.pwTel.value)){ alertMsg(f.pwTel, '핸드폰 번호 형식이 올바르지 않습니다.'); return; } f.actMode.value = "2"; } $.getJSON('ajax.findAccount.php', $(f).serialize(), function(data){ log(JSON.stringify(data)); if(data.rcode != 'T') alert(data.msg); if(data.rcode == 'T'){ if(oid == 'btnSearchId'){ alert('회원님의 아이디는 '+ data.msg +'입니다.'); }else{ alert(data.msg); } $('#findForm .join_row input').val(''); }else if(data.rcode == 'R'){ location.reload(); }else{ $('#'+ tokenkey).val(data.tkey); } }, 'POST'); }); if(window.app){ $('#idTel, #pwTel').val(window.app.getPhoneNumber()); }