`
wenhai_zhang
  • 浏览: 181686 次
  • 性别: Icon_minigender_1
  • 来自: 深圳
社区版块
存档分类
最新评论

【疑问】表单不提交

    博客分类:
  • java
阅读更多

表单代码:

<input type="button" value="浏览" onclick="setValue('file1')">
<form name="abc" action="${fn:contextpath()}/doUploadLicenseFile" method="post" enctype="multipart/form-data">
  <input type="hidden" name="funid" value="${funid }" />
  <input type="hidden" id="uploadIds" name="uploadIds">
  <input type="file" name="file1" id="file1"><br>
  <button type="submit" id="abcSub" style="visibility: hidden">submit</button>
</form>

 

var file = document.getElementById(id);
file.click();

 当我直接点击file组件的浏览时,表单可以提交。但我调用JS获取值之后,再提交表单,却无法提交?

 

 

问题已经查明:

在点击file组件的浏览取得文件后,表单提交正常,但如果使用按钮触发file组件得click事件获取文件后,表单无法提交!

 

问题原因正在查找中,已经在IE和360浏览器中均有问题。

 

进过多方搜索验证,此方法行不通。由于JS安全问题,致使表单无法提交,在JS调试过程中,Form提交时会遇到“htmlfile: 拒绝访问”错误。

解决方案正在修改中...

分享到:
评论
2 楼 pzxsheng 2012-06-20  
这个怎么解决
1 楼 magicguowei 2011-09-20  
请问楼主是怎么解决这个问题??,谢谢!

相关推荐

Global site tag (gtag.js) - Google Analytics