새창을 띄워서 선택하면 부모창에 값이 입력되게
혹시 아시는분 조언좀 부탁드려요.
우편번호 검색기 기능을 좀 변형해서 다른 용도로 쓸려고 바꾸는 중여요.
새창을 뛰워서 다른 db 에서 자료를 불러오는데까지는 됐는데...
해당 파일을 선택후 창이 닫아 져야 하는데 안닫아 지네요..
;; 이쪽은 제가 잘 몰라서..ㅠㅠ 관련 코드 조언좀 부탁해요.
-----------------------------------------
<table width="600" border="0" cellspacing="0" cellpadding="0">
<form name="fzip" method="get" autocomplete="off">
<input type=hidden name=se_01 value='<?=$se_01?>'>
<input type=hidden name=se_02 value='<?=$se_02?>'>
<tr>
<td colspan="2">
<table width="100%" height="50" border="0" cellpadding="0" cellspacing="0">
<tr>
<td align="center" valign="middle" bgcolor="#EBEBEB">
<table width="98%" height="40" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="5%" align="center" bgcolor="#FFFFFF" ><img src="<?=$g4[bbs_img_path]?>/icon_01.gif" width="5" height="5"></td>
<td width="35%" align="left" bgcolor="#FFFFFF" ><font color="#666666"><b>거래처키워드검색</b></font></td>
<td width="60%" bgcolor="#FFFFFF" ></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
<tr>
<td height="70" colspan="2" valign="bottom">
검색할 키워드를 입력하세요
</td>
</tr>
<tr>
<td height="20" colspan="2"></td>
</tr>
<tr>
<td width=130 align="right">검색키워드 </td>
<td><input type=text name=find_self value='<?=$find_self?>' required minlength=2 itemname='동(읍/면/리)' size=35> <input type=image src='<?=$g4[bbs_img_path]?>/btn_post_search.gif' border=0 align=absmiddle></td>
</tr>
<tr>
<td height="20" colspan="2"></td>
</tr>
</table>
<!-- 검색결과 여기서부터 -->
<td colspan="2">
<table width="100%" height="50" border="0" cellpadding="0" cellspacing="0">
<tr>
<td align="center" valign="middle" bgcolor="#EBEBEB">
<table width="98%" height="40" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="5%" align="center" bgcolor="#FFFFFF" ><img src="<?=$g4[bbs_img_path]?>/icon_01.gif" width="5" height="5"></td>
<td width="35%" align="left" bgcolor="#FFFFFF" ><font color="#666666"><b>거래처키워드검색</b></font></td>
<td width="60%" bgcolor="#FFFFFF" ></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
<tr>
<td height="70" colspan="2" valign="bottom">
검색할 키워드를 입력하세요
</td>
</tr>
<tr>
<td height="20" colspan="2"></td>
</tr>
<tr>
<td width=130 align="right">검색키워드 </td>
<td><input type=text name=find_self value='<?=$find_self?>' required minlength=2 itemname='동(읍/면/리)' size=35> <input type=image src='<?=$g4[bbs_img_path]?>/btn_post_search.gif' border=0 align=absmiddle></td>
</tr>
<tr>
<td height="20" colspan="2"></td>
</tr>
</table>
<!-- 검색결과 여기서부터 -->
<script language='javascript'>
document.fzip.addr1.focus();
</script>
document.fzip.addr1.focus();
</script>
<? if ($search_count > 0) { ?>
<table width="600" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="1" colspan="2" background="<?=$g4[bbs_img_path]?>/post_dot_bg.gif"></td>
</tr>
<tr>
<td height="50" colspan="2"><img src="<?=$g4[bbs_img_path]?>/zip_img_03.gif" width="99" height="13"></td>
</tr>
<tr>
<td width="10%"></td>
<td width="90%">
<table width=100% cellpadding=0 cellspacing=0>
<tr>
<td height=23 valign=top>총 <?=$search_count?>건 </td>
</tr>
<?
for ($i=0; $i<count($list); $i++)
{
echo "<tr><td height=19><a href='javascript:;' onclick=\"find_data('{$list[$i][UTCode]}', '{$list[$i][UTSangHo]}');\">{$list[$i][UTCode]} : {$list[$i][UTSangHo]}</a></td></tr>\n";
}
?>
<tr>
<td height=23>[끝]</td>
</tr>
</table>
</tr>
</table>
<script language="javascript">
function find_data(se_01, se_02)
{
var of = opener.document.<?=$se_01?>;
function find_data(se_01, se_02)
{
var of = opener.document.<?=$se_01?>;
of.<?=$se_01?>.value = se_01;
of.<?=$se_02?>.value = se_02;
of.<?=$se_02?>.value = se_02;
window.close();
return false;
}
</script>
<? } ?>
return false;
}
</script>
<? } ?>
첨부파일
|
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기
댓글 10개
-> document.fzip.find_self.focus();
이상 없어 보이는데요.
사이트주소있으면 보여주세요.
로컬인데 뜨나요.?
거래처 키워드 치면 새창...뜨거둥요..
거기서 같은 db가 아닌 다른 db에서 검색을 해서 불러오거둥요...
근데 불러와서 클릭하면 창이 안닫혀서요..
웹서버 포트좀 바꿔보세요.
<?=$se_01?> 이거나 <?=$se_02> 이 값이 제대로 있는지 확인해보세요.
document.fzip.addr1.focus();
-> document.fzip.find_self.focus();
이리 변경하니 스크립 오류가 나오는데요..
이건 해당창 키워드란에 포커스 거는겁니다.
오프너와는 상관없습니다.
<script language="JavaScript">
<!--
function newsWindow()
{window.open('팝업창주소.경로','SmallWindow','width=300,height=300,scrollbars=no');}
// -->
</script>
--------------<body>에 들어가는 소스 ----------------
<body onload="newsWindow();">
-------------<body> </body> 사이에 들어가는 소스 -------------------
새창에 들어가는 소스 (프레임 사용 않하는 경우)
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=euc-kr">
<title>테스트</title>
</head>
<body topmargin=0 leftmargin=0>
<table cellpadding="0" cellspacing="0" width="100%" height="100%">
<tr>
<td align="center">
<script>
function Go(){
opener.parent.location='http://webclub-x.net';
window.close();
}
</script>
<a href="#" onClick='Go();'><img src="../images/a0_250.gif" border=0></a>
<p>* 이미지 또는 텍스트를 클릭하시면 </p>
<p>링크시 본 창은 닫히고 </p>
<p>부모창으로 지정한 URL이 출력됩니다.<br></p>
</td>
</tr>
<tr>
<td align="center" bgcolor="#CCCCCC">
<a href="#" onClick='Go();'>테스트임돠<br>http://www.webclub-x.net</a>
</td>
</tr>
</table>
</body>
</html>
새창에 들어가는 소스 (프레임을 사용하는 경우)
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=euc-kr">
<title>테스트</title>
</head>
<body topmargin=0 leftmargin=0>
<table cellpadding="0" cellspacing="0" width="100%" height="100%">
<tr>
<td align="center">
<script>
function Go(){
opener.parent.여기에 프레임 이름을 넣어주세요.location='http://webclub-x.net';
window.close();