모달창에서 부모창으로 값넘기기
컨텐츠 정보
- 31,966 조회
- 33 추천
- 목록
본문
=========== 부모창 index.html ============
<script>
function winOpen(url)
{
var sFeatures = "dialogWidth: 500px; dialogHeight: 30px; center: yes; help: no; resizable: yes; status: no; scroll: no;";
var vReturn = window.showModalDialog(url, "_blank", sFeatures);
document.formname.textfield.value = vReturn;
}
</script>
<A href="javascript:winOpen('target.htm');">Test</A>
<form name="formname">
<input type="text" name="textfield">
</form>
=========== 모달창 target.htm ============
<font onclick="javascript:window.returnValue='음훼훼';window.close()">부모창 폼에 값넘기기</font>
<script>
function winOpen(url)
{
var sFeatures = "dialogWidth: 500px; dialogHeight: 30px; center: yes; help: no; resizable: yes; status: no; scroll: no;";
var vReturn = window.showModalDialog(url, "_blank", sFeatures);
document.formname.textfield.value = vReturn;
}
</script>
<A href="javascript:winOpen('target.htm');">Test</A>
<form name="formname">
<input type="text" name="textfield">
</form>
=========== 모달창 target.htm ============
<font onclick="javascript:window.returnValue='음훼훼';window.close()">부모창 폼에 값넘기기</font>
관련자료
댓글 0
등록된 댓글이 없습니다.