我的页面是这么写的
<input id="btSave" type=button value="保存" onclick="saveObjectInfo();"><form id="frm1_1" name="frm1_1" method="post" enctype="multipart/form-data" target="ifrIMG">
<input type="file" id="upload" name="upload">
</form><iframe id="ifrIMG" style="display:none" ></iframe>function saveObjectInfo()
{
document.getElementById("frm1_1").action="postImg.aspx?id=12";
document.getElementById("frm1_1").submit();
}我想实现的功能就是
通过提交 from 在postImg.aspx里面把图片存进数据库里面
父页面还有很多东西不止<form id="frm1_1"
没有一个 服务端的控件。不用服务端控件也是有其他原因的。
我想解决的问题是 提交from 但是不打开页面。
谢谢。
<input id="btSave" type=button value="保存" onclick="saveObjectInfo();"><form id="frm1_1" name="frm1_1" method="post" enctype="multipart/form-data" target="ifrIMG">
<input type="file" id="upload" name="upload">
</form><iframe id="ifrIMG" style="display:none" ></iframe>function saveObjectInfo()
{
document.getElementById("frm1_1").action="postImg.aspx?id=12";
document.getElementById("frm1_1").submit();
}我想实现的功能就是
通过提交 from 在postImg.aspx里面把图片存进数据库里面
父页面还有很多东西不止<form id="frm1_1"
没有一个 服务端的控件。不用服务端控件也是有其他原因的。
我想解决的问题是 提交from 但是不打开页面。
谢谢。
<iframe id="ifrIMG" name="ifrIMG" style="display:none" ></iframe>
<input id="btSave" type=button value="保存" onclick="saveObjectInfo();"><form id="frm1_1" name="frm1_1" method="post" enctype="multipart/form-data" target="_ifrIMG">
<input type="file" id="upload" name="upload">
</form>
<iframe name="_ifrIMG" style="display:none" width="300" height="200" ></iframe>
<script>function saveObjectInfo()
{
document.getElementById("frm1_1").action="http://localhost/mtest.php";
document.getElementById("frm1_1").submit();
}
</script>
或者模拟个:提交到某个处理页面 然后再返回当前页面
有了name 也是会打开页面的