Html & Script

모달창에서 부모창으로 값넘기기

페이지 정보

본문

=========== 부모창 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>

관련자료

등록된 댓글이 없습니다.
Today's proverb
전력을 다하여 자신에게 충실하고 올바른 길로 나가라. 참으로 내 생각을 채울 수 있는 것은 나 자신 뿐이다. 나를 변화시킬 수 있는 건 오로지 나뿐이다. (우렐리우스)