如下代码:
<div style="width:500px; height:25px;">
<form id="ff" name="form1" action="/shop/UpFileServlet" method="post" enctype="multipart/form-data">
<input type="file" name="file1" id="file1" size="20" maxlength="80">
<input name="submit1" id="btn1" type="submit" value="图片上传">
</form>
<div> <form name="form2" method="post" action="">
<label>
<input type="button" name="Submit" value="按钮" onClick="openFile()" >
</label>
</form> <script>
function openFile()
{
alert("1");
document.getElementById("file1").click();
alert("3");
var oForm = document.getElementById("ff");
alert(oForm.name);
alert("4")
oForm.submit();
alert("2");
document.getElementById("btn1").click();
alert("4");
}
</script>
问题:当执行到 document.getElementById("btn1").click();
处时 提示 拒绝访问 。急!急!急!急!急!急!急!
<div style="width:500px; height:25px;">
<form id="ff" name="form1" action="/shop/UpFileServlet" method="post" enctype="multipart/form-data">
<input type="file" name="file1" id="file1" size="20" maxlength="80">
<input name="submit1" id="btn1" type="submit" value="图片上传">
</form>
<div> <form name="form2" method="post" action="">
<label>
<input type="button" name="Submit" value="按钮" onClick="openFile()" >
</label>
</form> <script>
function openFile()
{
alert("1");
document.getElementById("file1").click();
alert("3");
var oForm = document.getElementById("ff");
alert(oForm.name);
alert("4")
oForm.submit();
alert("2");
document.getElementById("btn1").click();
alert("4");
}
</script>
问题:当执行到 document.getElementById("btn1").click();
处时 提示 拒绝访问 。急!急!急!急!急!急!急!
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货