<input name="Export2" type="button" class="buttonn" value="导 入" onclick="document.filefrm.file.click();document.filefrm.submit();"/>
<form action="Excel2Accpost.asp" method="POST" name="filefrm" id="filefrm" enctype="multipart/form-data">
<input type="file" name="file" id="file" style="display:none" /></form>以上代码想实现隐藏文件表单,用自己的按钮调用文件打开对话框,并且提交表单,系统老提示错误 拒绝访问,我试着把
document.filefrm.file.click(); 改成document.getElementById("file").click(); 也不行 ,请大家帮忙,另外我的这个网页有2个独立的form 应该不影响把
<form action="Excel2Accpost.asp" method="POST" name="filefrm" id="filefrm" enctype="multipart/form-data">
<input type="file" name="file" id="file" style="display:none" /></form>以上代码想实现隐藏文件表单,用自己的按钮调用文件打开对话框,并且提交表单,系统老提示错误 拒绝访问,我试着把
document.filefrm.file.click(); 改成document.getElementById("file").click(); 也不行 ,请大家帮忙,另外我的这个网页有2个独立的form 应该不影响把
你报错拒绝访问 就是因为这句
和document.filefrm.submit();都没错,这是不是说明document.getElementById("file").click();也没问题的啊,合在一起就出问题,请问有什么方法实现我要的功能啊
document.filefrm.file.click();
document.filefrm.submit();
}
<input name="Export2" type="button" class="buttonn" value="导 入" onclick="tijiao();"/>这样试试~·