팝업창 체크한 후 부모창으로 넘기기??

· 15년 전 · 1639 · 2
안녕하세요! 그누보드 질문은 아니지만^^;;;
아래 소스는 자식창에 데이터를 한줄을 선택하면 부모창에 입력되는 형식입니다.
근데 이걸 체크박스를 이용해서 부모창에 넣고 싶습니다! (총 3개만 선택가능)
어떻게할지 ... 답변 부탁 드립니다. (_ _)


<부모창>

<script>
function profess_zip() {
res2=window.open("./add.php");
res2.focus();
return false;
}
</script>
1. <input type="text" name="name" id="name"> <input type=text name="tel" id="tel" >
2. <input type="text" name="name2" id="name2"> <input type=text name="tel2" id="tel2" >
3. <input type="text" name="name3" id="name3"> <input type=text name="tel3" id="tel3" >

<A HREF="#" onClick="return profess_zip()" ><img src="btn_select2.gif" alt="검색하기"></A>




<자식(팝업창), add.php>

<script type="text/javascript">

function profess_zip(val, val2){
var ctbox = document.getElementById("name");

var ctbox2 = document.getElementById("tel");

var ptbox = parent.opener.document.getElementById("name");

var ptbox2 = parent.opener.document.getElementById("tel");


ptbox.value =val;

ptbox2.value = val2;

window.close();
}
</script>

<form name="form2">
<input name="city" type="text">
<input type="submit" value="찾기" onClick="return FindZip()">

<table>
<tr>
<td>이름</td>
<td>연락처</td>
</tr>

<?
$SQL = "select * from table order by id";
for($i=0;$i<$TotalCount;$i++) {
$id = mysql_result($Rs, $i, "id");
$name = mysql_result($Rs, $i, "name");
$tel = mysql_result($Rs, $i, "tel");
?>

<tr onClick="profess_zip('<?=$name?>', '<?=$tel?>');">>
<td><?=$name?></td>
<td><?=$tel?></td>
</tr>
<? } ?>

</fomr>
</table>
|

댓글 2개

$SQL = "select * from table order by id";
for($i=0;$i<$TotalCount;$i++) {
$id = mysql_result($Rs, $i, "id"); <<<<<<<<
$name = mysql_result($Rs, $i, "name"); <<<<<<<<
$tel = mysql_result($Rs, $i, "tel"); <<<<<<<<<<<
?>

<tr onClick="profess_zip('<?=$name?>', '<?=$tel?>');">>
<td><?=$name?></td>
<td><?=$tel?></td>
</tr>
<? } ?>

위 <<<<<<<<< 표시한 부분을 배열값으로 처리해야 합니다.
위와 같이 처리하게 되면 $id, $name, $tel 변수의 값은 님이 원하는것처럼 처리되지 않습니다...
마지막 값이 출력될 것입니다...

배열값으로 처리하세요
아...그렇군요~ 그럼... 배열로 처리해서... 어떻게 넘겨야 하는건가요 ㅠㅠ
댓글을 작성하시려면 로그인이 필요합니다.

그누4 질문답변

그누보드4 관련 질문은 QA 로 이전됩니다. QA 그누보드4 바로가기 기존 게시물은 열람만 가능합니다.

+
제목 글쓴이 날짜 조회
15년 전 조회 1,250
15년 전 조회 957
15년 전 조회 1,071
15년 전 조회 955
15년 전 조회 990
15년 전 조회 823
15년 전 조회 2,065
15년 전 조회 996
15년 전 조회 823
15년 전 조회 1,640
15년 전 조회 3,870
15년 전 조회 958
15년 전 조회 1,029
15년 전 조회 858
15년 전 조회 981
15년 전 조회 1,853
15년 전 조회 1,552
15년 전 조회 1,148
15년 전 조회 913
15년 전 조회 795