html file 拒绝访问错误

今天遇到一个需求需要把基本资料和图片资料分成两个form表单分别提交,在提交基本资料表单然后再提交图片表单时报拒绝访问错误。查找原因是图片域文件上传采用了button的onclick事件让file.onclick代替默认的浏览所引起的js安全问题。采用css控制选择文件的样式透明,浮在选择照片的按钮上方就可以了。如下:
<form name="photoForm" id="photoForm" method="post" action="xxx.action" enctype="multipart/form-data" >
<input name="pbivo.pfid" type="hidden" id="person" value=""/>
<table border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td align="center" colspan="1">
<div id="pImag32" style="filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=scale);width:93px;height:125px;"></div>
<input name="pbivo.imagefile" id="imagefile" type="file" οnchange="Preview(this);" style="position: absolute;left: 25%; filter: alpha(opacity = 0); width: 1px; CURSOR: hand;"
hidefocus require="false" dataType="Filter"
msg="照片文件类型只能是(*.jpg,*.gif,*.jpeg)文件!"
accept="jpg,JPG,gif,GIF,JPEG,jpeg"/>

</td>
</tr>
<tr>
<td align="center" class="td13">
<input type="button" class="button_2" value="选择照片" /><br>
<input type="button" class="button_2" value="删除照片" name="delelePhoto1" οnclick="deletePhoto();"/>
</td>
</tr>
</table>
</form>
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值