폼메일에 주소입력란 추가할 수 있나요?
본문
폼메일에 주소입력란 추가할 수 있나요?
가능하다면 참고할만한 부분이 있을까요 ㅠㅠ?
현재 바디에는
<tr class="address_box">
<th scope="row"><label for="add_ress">주소</label></th>
<td>
<label for="od_zip">우편번호</label>
<input type="text" name="od_zip" value="<?php echo $member['mb_zip1'].$member['mb_zip2']; ?>" id="od_zip" required size="8" maxlength="6" placeholder="우편번호" class="ipt int2">
<button type="button" class="btn_address" onclick="win_zip('forderform', 'od_zip', 'od_addr1', 'od_addr2', 'od_addr3', 'od_addr_jibeon');">주소 검색</button><br>
<input type="text" name="od_addr1" value="<?php echo get_text($member['mb_addr1']) ?>" id="od_addr1" required class="frm_input frm_address ipt int" size="60" placeholder="기본주소">
<label for="od_addr1">기본주소</label><br>
<input type="text" name="od_addr2" value="<?php echo get_text($member['mb_addr2']) ?>" id="od_addr2" class="frm_input frm_address ipt int" size="60" placeholder="상세주소">
<label for="od_addr2">상세주소</label>
<br>
<input type="text" name="od_addr3" value="<?php echo get_text($member['mb_addr3']) ?>" id="od_addr3" class="frm_input frm_address ipt int" size="60" readonly="readonly" placeholder="참고항목">
<label for="od_addr3">참고항목</label><br>
<input type="hidden" name="od_addr_jibeon" value="<?php echo get_text($member['mb_addr_jibeon']); ?>" class="ipt int">
</td>
</tr>
이렇게 추가한 상태입니다. 근데 주소검색을 눌러도 뭐 동작이 안되어서요 ㅠㅠ
!-->답변 5
우편번호 찾기를 쓸려면
add_javascript(G5_POSTCODE_JS, 0); //다음 주소 js
상단에 이 코드를 넣으셔야 됩니다.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<?php
include_once('./_common.php');
add_javascript(G5_POSTCODE_JS, 0); //다음 주소 js
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>세금계산서 정보 입력 폼</title>
<style>
table {
width: 100%;
border-collapse: collapse;
margin: 0 auto;
}
tr {
display: inline-table;
margin-bottom: 1%;
margin-top: 1%;
width: 96%;
}
.tx_ar {
width: 96%;
display: inline-table;
margin-bottom: 1%;
margin-top: 1%;
}
.tx_area {
border-radius: 5px !important;
border: 1px solid #c9c9c9;
width: 100%;
}
li {
list-style: none;
}
th {
width: 90px;
padding: 10px;
color: #327EB2;
font-size: .77em;
font-family: "Nanum Square", "Nanum Gothic", "dotum", "Poppins", sans-serif;
font-weight: 700;
}
td {
}
td input.int {
padding: 5px 3px;
border: 1px solid #c9c9c9;
width: 100%;
}
td input.int2 {
padding: 5px 3px;
border: 1px solid #c9c9c9;
width: 30%;
}
btn_submit {}
.btn_com {
display: block;
width: 100%;
margin: 0 auto;
}
.btn_com td {
display: block;
margin: 0 auto;
}
.radio_box {
-webkit-appearance: auto;
appearance: auto;
margin-right: 10px;
}
.radio_box_la {
margin-right: 20px;
margin-top: 5px;
margin-left: 5px;
vertical-align: baseline;
}
.true_chk {
width: 100%;
}
.chk_txt {
display: inline-block;
font-size: 1em;
display: block;
font-weight: bold;
color: #333;
padding: 5px 0px;
}
.chk_txt2 {
display: inline-block;
font-size: .75em;
margin-right: 20px;
}
.chk_txt3 {
display: inline-block;
font-size: .85em;
margin-right: 20px;
color: #1ba0dc;
}
.chk1, .chk2, .chk3, .chk4 {
display: inline-block;
width: 50%;
margin-bottom: 20px;
}
.check_box_la {
margin-right: 20px;
width: 125px;
}
.address_box td label {
font-size: .75em;
}
</style>
</head>
<body>
<form name="contactform" method="post" action="send2.php">
<table>
<td style="display:block;"><span class="chk_txt3" style="width:100%;">※ 아래내용을 꼭 기재해 주세요.</span></td>
<tr class="true_chk">
<tr>
<th scope="row">
<label for="c_num">사업자번호</label></th>
<td>
<input name="c_num" type="text" class="ipt int" size="30" maxlength="30" value="" required >
</td>
</tr>
<tr>
<th scope="row">
<label for="com_name">학교 / 기업명</label></th>
<td>
<input name="com_name" type="text" class="ipt int" size="30" maxlength="50" value="" required >
</td>
</tr>
<tr>
<th scope="row">
<label for="first_name">대표자 명</label></th>
<td>
<input name="first_name" type="text" class="ipt int" size="30" maxlength="50" value="" required >
</td>
</tr>
<tr>
<th scope="row">
<label for="upte">업태</label></th>
<td>
<input name="upte" type="text" class="ipt int" size="30" maxlength="50" value="" required >
</td>
</tr>
<tr>
<th scope="row">
<label for="upjong">업종</label></th>
<td>
<input name="upjong" type="text" class="ipt int" size="30" maxlength="50" value="" required >
</td>
</tr>
<tr class="address_box">
<th scope="row"><label for="add_ress">주소</label></th>
<td>
<label for="od_zip">우편번호</label>
<input type="text" name="od_zip" value="<?php echo $member['mb_zip1'].$member['mb_zip2']; ?>" id="od_zip" required size="8" maxlength="6" placeholder="우편번호" class="ipt int2">
<button type="button" class="btn_address" onclick="win_zip('forderform', 'od_zip', 'od_addr1', 'od_addr2', 'od_addr3', 'od_addr_jibeon');">주소 검색</button><br>
<input type="text" name="od_addr1" value="<?php echo get_text($member['mb_addr1']) ?>" id="od_addr1" required class="frm_input frm_address ipt int" size="60" placeholder="기본주소">
<label for="od_addr1">기본주소</label><br>
<input type="text" name="od_addr2" value="<?php echo get_text($member['mb_addr2']) ?>" id="od_addr2" class="frm_input frm_address ipt int" size="60" placeholder="상세주소">
<label for="od_addr2">상세주소</label>
<br>
<input type="text" name="od_addr3" value="<?php echo get_text($member['mb_addr3']) ?>" id="od_addr3" class="frm_input frm_address ipt int" size="60" readonly="readonly" placeholder="참고항목">
<label for="od_addr3">참고항목</label><br>
<input type="hidden" name="od_addr_jibeon" value="<?php echo get_text($member['mb_addr_jibeon']); ?>" class="ipt int">
</td>
</tr>
<tr>
<th scope="row">
<label for="email">발행 이메일</label></th>
<td>
<input name="email" type="text" class="ipt int" size="30" maxlength="80" value="" required >
</td>
</tr>
<tr>
<th scope="row">
<label for="telephone">연락처</label></th>
<td>
<input name="telephone" type="text" class="ipt int" size="30" maxlength="30" value="" required >
</td>
</tr>
<tr class="tx_ar">
<th scope="row">
<label for="comments">기타문의<br><strong style="color:#ccc; font-size:.77em; font-weight:100;">(생략가능)</strong></label></th>
<td height="70" valign="bottom">
<textarea name="comments" cols="50" class="tx_area int" rows="5" placeholder="기타 카테고리 또는 문의사항을 적어주세요." value=""></textarea></td>
</tr>
<tr class="true_chk">
<th scope="row">
<label for="true_chk">개인정보<br>수집동의</label></th>
<td>
<span class="chk_txt2">작성해주신 이름. 업체명, 연락처, 이메일은 문의 내용 확인 및 답변처리 용도로 쓰이며 6개월간 보관후 파기합니다.</span>
<label class="radio_box_la"><input type="radio" name="true_chk" value="동의" class="radio_box" required > 동의</label>
<!--<label class="radio_box_la"><input type="radio" name="true_chk" value="비동의" class="radio_box"> 비동의</label>-->
</td>
</tr>
<tr class="btn_com">
<td height="40" colspan="2" style="text-align:center">
<input type="submit" value="작성완료" class="btn_submit" style=" width: 30%;
padding: 10px;
border-radius: 30px;">
<!--<input name="재설정" type="reset" value="다시작성" class="btn_submit">--></td>
</tr>
</table>
</form>
</body>
</html>
전체 코드는 이렇습니다 ㅠ
!-->그래도 안된다면
win_zip
해당 함수가 포함되어 있지 않아서 그런거겠죠
/js/common.js 가 호출되어야 작동할겁니다.
head.sub.php 를 인클루드하셔야 될겁니다.
common.js 만 호출하면 그누보드 선언된 변수들 때문에 안될수도 있습니다.
head.sub.php 를 호출하셔야 될거 같고
<script src="/js/common.js"></script>
common.js 만 호출한다면 위와 같이 하시면 됩니다.
허용하지 않는 파라미터 관련 내용은
add_javascript('<script src="https://t1.daumcdn.net/mapjsapi/bundle/postcode/prod/postcode.v2.js"></script>', 0);
부분에서
add_javascript('<script src="https://t1.daumcdn.net/mapjsapi/bundle/postcode/prod/postcode.v2.js "></script>', 0);
.js 뒷 부분의 띄어쓰기로 해결 가능합니다.
답변을 작성하시기 전에 로그인 해주세요.