그누보드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년 전 | 4046 | |
| 29 |
아우겐나이스
|
21년 전 | 4435 | |
| 28 |
아우겐나이스
|
21년 전 | 3461 | |
| 27 | 21년 전 | 5830 | ||
| 26 | 21년 전 | 3105 | ||
| 25 | 21년 전 | 6078 | ||
| 24 | 18년 전 | 3645 | ||
| 23 | 21년 전 | 3634 | ||
| 22 | 21년 전 | 4243 | ||
| 21 | 21년 전 | 3817 | ||
| 20 | 21년 전 | 4221 | ||
| 19 | 21년 전 | 6678 | ||
| 18 | 21년 전 | 4733 | ||
| 17 | 21년 전 | 6985 | ||
| 16 | 21년 전 | 4169 | ||
| 15 | 21년 전 | 2629 | ||
| 14 | 21년 전 | 4974 | ||
| 13 | 21년 전 | 3398 | ||
| 12 |
Recluse
|
21년 전 | 3876 | |
| 11 |
아우겐나이스
|
21년 전 | 3567 | |
| 10 |
Recluse
|
21년 전 | 3392 | |
| 9 | 21년 전 | 3980 | ||
| 8 | 21년 전 | 5164 | ||
| 7 | 21년 전 | 4758 | ||
| 6 | 21년 전 | 5677 | ||
| 5 | 21년 전 | 4111 | ||
| 4 | 21년 전 | 4835 | ||
| 3 | 21년 전 | 4739 | ||
| 2 | 21년 전 | 3238 | ||
| 1 | 22년 전 | 4337 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기