首先在父页面中有一个form
<form method="post" action="PICON4.ASP" enctype="multipart/form-data" name=myform onSubmit='return validate()'>
<td><input name="filepath" type="hidden" value="UpFiles/" ><input type="file" name="src" size="28" value="浏览">
<input type="submit" value="添加" name="B1" class="txt " IsShowProcessBar="True"></td>
</form>
我想在PICON4.ASP页面中使用javascript将一个值保存在父页面中的<input name="filepath" type="hidden" value="UpFiles/" >中
在PICON4.ASP中javascript如下:parent.document.getElementById('filepath').value='xxx'
这样写不行啊,
请大家指教!
<form method="post" action="PICON4.ASP" enctype="multipart/form-data" name=myform onSubmit='return validate()'>
<td><input name="filepath" type="hidden" value="UpFiles/" ><input type="file" name="src" size="28" value="浏览">
<input type="submit" value="添加" name="B1" class="txt " IsShowProcessBar="True"></td>
</form>
我想在PICON4.ASP页面中使用javascript将一个值保存在父页面中的<input name="filepath" type="hidden" value="UpFiles/" >中
在PICON4.ASP中javascript如下:parent.document.getElementById('filepath').value='xxx'
这样写不行啊,
请大家指教!
如果你是提交到一个iframe里(设置form的target)倒是可以用window.top.document.getElementById('filepath')来访问。