Notice
Recent Posts
Recent Comments
Link
«   2025/05   »
1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30 31
Tags more
Archives
Today
Total
관리 메뉴

기록

다음 카카오 주소검색 추가 본문

JAVA

다음 카카오 주소검색 추가

9400 2023. 2. 3. 16:45

추가

<script src="https://ssl.daumcdn.net/dmaps/map_js_init/postcode.v2.js"></script>

 

 

	<div class="mb-3">
	<div>
 		<label for="postNo" class="form-label">우편번호</label> 
 	</div>
 	<div>
		<input type="text" class="form-control"
			id="postNo" name="postNo" placeholder="우편번호를 입력해주세요"
			style="width:80%; float:left;">
			<input type="button" class="btn btn-success" value="우편번호검색"
			style="width:20%; float:right;" id="btnPostno">
	</div>
	</div>
	<div class="mb-3">
		<label for="cusAddr" class="form-label">주소
			</label> <input type="text" class="form-control"
			id="cusAddr" name="cusAddr" placeholder="주소를 입력해주세요">
	</div>
	<div class="mb-3">
		<label for="addrDet" class="form-label">상세주소
			</label> <input type="text" class="form-control"
			id="addrDet" name="addrDet" placeholder="상세번호를 입력해주세요">
	</div>

 

 

 

<script>
$(function(){
	$('#btnPostno').on('click',function(){
		new daum.Postcode({
			//다음창에서 검색이 완료되면 콜백함수에 의해 결과 데이터가 data객체로 들어옴
			oncomplete:function(data){
				//우편번호
				$('#postNo').val(data.zonecode);
				//주소
				$('#cusAddr').val(data.address);
				$('#addrDet').val(data.buildingName);
			}
		}).open();
	});	
});	
</script>

 

 

클릭시 

'JAVA' 카테고리의 다른 글

구글차트 사용법  (0) 2023.02.10
JAVA Spring MAPPER 인터페이스 설정  (0) 2023.02.06
JAVA sping BOOK 테이블 list 띄우기  (0) 2023.01.31
JAVA sping BOOK 테이블 Create  (0) 2023.01.31
JAVA Spring 파일 업로드 예제 +미리보기  (0) 2023.01.30
Comments