그누보드5 에 Daum 우편번호 찾기 API 연동 하기
관련파일 : skin/member/basic/register_form.skin.php
<a href="<?php echo G5_BBS_URL ?>/zip.php?frm_name=fregisterform&frm_zip1=mb_zip1&frm_zip2=mb_zip2&frm_addr1=mb_addr1&frm_addr2=mb_addr2&frm_addr3=mb_addr3&frm_jibeon=mb_addr_jibeon" id="reg_zip_find" class="btn_frmline win_zip_find" target="_blank">주소 검색</a><br>
를
<a href="javascript:openDaumPostcode();" id="reg_zip_find" class="btn_frmline">주소 검색</a><br>
로 변경.
이때 a 태그에 들어있던 win_zip_find 클래스를 삭제하는것이 포인트 입니다.
삭제를 안하면 기존 win_zip_find click 이벤트와 충돌이 납니다.
그리고 맨 하단에 아래 자바스크립트 코드를 추가합니다.
<script src="http://dmaps.daum.net/map_js_init/postcode.js"></script>
<script type="text/javascript">
<!--
function openDaumPostcode() {
new daum.Postcode({
oncomplete: function(data) {
document.getElementById('reg_mb_zip1').value = data.postcode1;
document.getElementById('reg_mb_zip2').value = data.postcode2;
document.getElementById('reg_mb_addr1').value = data.address;
document.getElementById('reg_mb_addr2').focus();
document.getElementById('reg_mb_addr3').value = data.addressEnglish;
}
}).open();
}
//-->
</script>
모바일은 아래 링크를 참조하세요.
댓글 1개
VeritasLuxMea
11년 전
감사합니다 !
게시판 목록
프로그램
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 30 |
아우겐나이스
|
21년 전 | 4081 | |
| 29 |
아우겐나이스
|
21년 전 | 4462 | |
| 28 |
아우겐나이스
|
21년 전 | 3487 | |
| 27 | 21년 전 | 5870 | ||
| 26 | 21년 전 | 3147 | ||
| 25 | 21년 전 | 6119 | ||
| 24 | 18년 전 | 3682 | ||
| 23 | 21년 전 | 3674 | ||
| 22 | 21년 전 | 4269 | ||
| 21 | 21년 전 | 3851 | ||
| 20 | 21년 전 | 4252 | ||
| 19 | 21년 전 | 6713 | ||
| 18 | 21년 전 | 4758 | ||
| 17 | 21년 전 | 7008 | ||
| 16 | 21년 전 | 4194 | ||
| 15 | 21년 전 | 2661 | ||
| 14 | 21년 전 | 4996 | ||
| 13 | 21년 전 | 3419 | ||
| 12 |
Recluse
|
21년 전 | 3903 | |
| 11 |
아우겐나이스
|
21년 전 | 3589 | |
| 10 |
Recluse
|
21년 전 | 3424 | |
| 9 | 21년 전 | 4036 | ||
| 8 | 21년 전 | 5201 | ||
| 7 | 21년 전 | 4788 | ||
| 6 | 21년 전 | 5723 | ||
| 5 | 21년 전 | 4143 | ||
| 4 | 21년 전 | 4873 | ||
| 3 | 21년 전 | 4774 | ||
| 2 | 21년 전 | 3276 | ||
| 1 | 22년 전 | 4364 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기