우편번호가 필드값에 먹히질 않습니다ㅜ
본문
<?php
$g4_path = "../common.php"; // 그누보드의 common.php이 위치한 경로를 지정해주세요
include_once("$g4_path/common.php");
?>
<style>
.input_form table {width:100%; color:#000; font-size:12px; margin:10px 0 10px 0;}
.input_form table td {height:40px;/*56px*/ padding:0 0 0 18px;}
.input_form table tr {border-bottom:1px solid #eceeef;}
.input_form table th {background:url("/images/bg_table_line.png") right 16px no-repeat;}
.content{font-family:'Nanum Gothic', sans-serif}
input {height:22px; }
select {height:26px; width:100px;}
textarea {margin:5px 0; width:99%;}
input[type=text] {width:30%;}
input[type=mail] {width:40%;}
input[type=subject] {width:40%;}
input[type=password] {width:20%;}
input[type=number] {width:10%;}
.must {margin:0 0 0 5px; vertical-align:-1px;}
.btn {display:block; text-align:right; padding:24px 0 0; background:url("/images/bg_notice_line1.png") left top no-repeat;}
.border_bottom { border-bottom:1px solid #ccc;}
</style>
<script>
function inputCheck(frm){
if(frm.cname.value == '') { alert('업체명을 입력해 주세요'); frm.cname.focus(); return false; }
if(frm.name.value == '') { alert('담당자명을 입력해 주세요'); frm.name.focus(); return false; }
if(frm.tel1.value == '') { alert('연락처를 입력해 주세요'); frm.tel1.focus(); return false; }
if(frm.tel2.value == '') { alert('연락처를 입력해 주세요'); frm.tel2.focus(); return false; }
if(frm.tel3.value == '') { alert('연락처를 입력해 주세요'); frm.tel3.focus(); return false; }
if(frm.zip1.value == '') { alert('검색창을 이용해주세요'); frm.zip1.focus(); return false; }
if(frm.zip2.value == '') { alert('검색창을 이용해주세요'); frm.zip2.focus(); return false; }
if(frm.zip2.value == '') { alert('검색창을 이용해주세요'); frm.zip2.focus(); return false; }
if(frm.email.value == '') { alert('이메일을 입력해 주세요'); frm.email.focus(); return false; }
if(frm.subject.value == '') { alert('제목을 입력해 주세요'); frm.subject.focus(); return false; }
if(frm.content.value == '') { alert('내용을 입력해 주세요'); frm.content.focus(); return false; }
}
function win_zip(frm_name, frm_zip1, frm_zip2, frm_addr1, frm_addr2)
{
url = "/gnuboard4/bbs/zip.php?frm_name="+frm_name+"&frm_zip1="+frm_zip1+"&frm_zip2="+frm_zip2+"&frm_addr1="+frm_addr1+"&frm_addr2="+frm_addr2;
window.open(url, "winZip", "left=50,top=50,width=616,height=460,scrollbars=1");
}
</script>
<img src="img/other/co/co.jpg" border=0 />
<form class="input_form" method='post' name='fwrite' enctype='multipart/form-data' action='send.php' onSubmit="return inputCheck(this);">
<table cellpadding='0' cellspacing='0' border='0' align='center'>
<!--<tr>
<td align="right" colspan="3"><font color="red">*</font>항목은 필수 입력 사항입니다.</td>
</tr>-->
<tr>
<th align="right" class="border_bottom">업체명 <img src="../img/icon/check.png" /></th>
<td class="border_bottom"><input type='text' name='cname' size="20" class='inputForm' value="<?=$cname?>"></td>
<tr>
<th align="right" class="border_bottom"><b>담당자 <img src="../img/icon/check.png" /></b></th>
<td class="border_bottom"><input type='text' name='name' size="20" class='inputForm' value="<?=$name?>"> </td>
</tr>
<tr>
<th align="right" class="border_bottom"><b>연락처 <img src="../img/icon/check.png" /></b></th>
<td colspan="3" class="border_bottom">
<input type="number" name="tel1" maxlength="4" value="<?=$tel[0]?>">
<!-- <select name="tel1">
<option value=""><?if($tel[0] != "") echo $tel[0]; else echo "선택";?></option>
<option value="010">010</option>
<option value="011">011</option>
<option value="016">016</option>
<option value="017">017</option>
<option value="018">018</option>
<option value="019">019</option>
</select>-->
-
<input type="number" name="tel2" maxlength="4" value="<?=$tel[1]?>">
-
<input type="number" name="tel3" maxlength="4" value="<?=$tel[2]?>">
<!--<img class="must" src="/images/txt/txt_input_input.png" alt="필수입력">-->
EX ) 지역번호 - 123 - 4567
</td>
</tr>
<tr>
<th align="right" class="border_bottom">주소 <img src="../img/icon/check.png" /></th>
<td><form name="hpwrite" method="post" action="">
<input size="4" name="zip1" itemname="우편번호 앞자리" readonly value="<?=$zip1?>" class='inputForm'>-<input size="4" name="zip2" itemname="우편번호 뒷자리" readonly value="<?=$zip2?>" class='inputForm'>
<a href="javascript:;" onClick="win_zip('hpwrite', 'zip1', 'zip2', 'add1', 'add2');"><img src="img/btn_post.gif" border="0" align="absmiddle" /></a><br />
<input name="add1" type="text" style="width:300px" value="<?=$add1?>" readonly /><br />
<input name="add2" type="text" style="width:300px" value="<?=$add2?>" readonly />
</form>
</td>
<tr>
<th align="right" class="border_bottom"><b>이메일 <img src="../img/icon/check.png" /></b></th>
<td colspan="3" class="border_bottom">
<input type="mail" name="email" size="30" class="inputForm" value="<?=$email?>">
</td>
</tr>
<tr>
<th align="right" class="border_bottom"><b>제목 <img src="../img/icon/check.png" /></b></th>
<td colspan="3" class="border_bottom">
<input type="subject" name="subject" size="30" class="inputForm" value="<?=$subject?>">
</td>
</tr>
<!--<tr>
<th align="right"><b>상담분야 <img src="../img/icon/check.png" /></b></th>
<td colspan="3">
<select type='text' name='subject' class='gbox' value="<?=$subject?>">
<option value="">선택하세요</option>
<option value="창업문의">창업문의</option>
<option value="기타문의">기타문의</option>
</select>
</td>
</tr>-->
<tr>
<th align="right" class="border_bottom"><b>내용 <img src="../img/icon/check.png" /></b></th>
<td colspan='4' class="border_bottom"><textarea name='content' style='width:600px; height:150px' class='gbox' value="<?=$content?>"></textarea></td>
</tr>
<tr>
<th align="right" class="border_bottom"><b>첨부파일</b></th>
<td colspan='4' class="border_bottom"><input type='file' name='upfile' style='width:300px' class='gbox'></td>
</tr>
<th></th>
<th style="text-align:right; padding:10px 0 10px 0"><input type='submit' value='신청하기' class='gbox' style='background:#fff; width:100px; height:30px; border:1px solid #ccc;'>
<input type='reset' value='다시쓰기' class='gbox' style='background:#fff; width:100px; height:30px; border:1px solid #ccc;'></th>
<th></th>
<th></th>
</tr>
</table>
</form>
이렇게 설정을 해 두었는데
실제로 검색창까지는 뜨는데 주소를 클릭하게 되면 창이 닫혀지지도 않고
필드값에도 먹히질 않습니다.
어떻게 해야하나요 ㅜ?
실제로 먹히지 않는 주소를 링크로 걸어두었습니다.
도와주세요 ㅜㅜ
!-->답변 2
function win_zip(frm_name, frm_zip1, frm_zip2, frm_addr1, frm_addr2, frm_addr3, frm_jibeon)
{
url = "/bbs/zip.php?frm_name="+frm_name+"&frm_zip1="+frm_zip1+"&frm_zip2="+frm_zip2+"&frm_addr1="+frm_addr1+"&frm_addr2="+frm_addr2+"&frm_addr3="+frm_addr3+"&frm_jibeon="+frm_jibeon;
window.open(url, "winZip", "left=50,top=50,width=616,height=460,scrollbars=1");
}
<input size="4" name="zip1" itemname="우편번호 앞자리" readonly value="<?=$zip1?>" class='inputForm'>-<input size="4" name="zip2" itemname="우편번호 뒷자리" readonly value="<?=$zip2?>" class='inputForm'>
<a href="javascript:;" onClick="win_zip('fwrite', 'zip1', 'zip2', 'add1', 'add2', 'add3', 'jibeon');"><img src="img/btn_post.gif" border="0" align="absmiddle" /></a><br />
<input name="add1" type="text" style="width:300px" value="<?=$add1?>" readonly /><br />
<input name="add2" type="text" style="width:300px" value="<?=$add2?>" readonly />
<input name="add3" type="text" style="width:300px" value="<?=$add3?>" readonly />
onClick="win_zip('hpwrite'
=>
onClick="win_zip('fwrite'