问个问题,
在父窗体有一个,
<input type="hidden" name="s" id="s" value="0"/>在这个窗体上弹出一个小子窗体,
并选择一个控件操作,
然后再确定,提交到本子窗体,
这时运行JS
<script>
window.parent.document.getElementById("s").value=s;
</script>这时提示错误:
window.parent.document.getElementById("")
是空或者NULL
这个该怎么解决?
在父窗体有一个,
<input type="hidden" name="s" id="s" value="0"/>在这个窗体上弹出一个小子窗体,
并选择一个控件操作,
然后再确定,提交到本子窗体,
这时运行JS
<script>
window.parent.document.getElementById("s").value=s;
</script>这时提示错误:
window.parent.document.getElementById("")
是空或者NULL
这个该怎么解决?
如果是用模式对话框打开新窗口,可以这样
在子窗口中
var pWin = top.parent.dialogArguments;
pWin.document.getElementById("");
要是iframe的话就用
window.parent.document.getElementById('id').value;
如果是open或者showModalDialog开来的子窗口的话,就不是这样传值了。