fileupload控件:如何在客户端清除fileUpLoad控件的文件路径来源: 发布时间:星期六, 2008年12月13日 浏览:161次 评论:0
今天在写
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 引用 创建 ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 具体解决代码:view plaincopy to clipboardpr ![]() //把这个JS放到页面 ![]() <script language="javascript" type="text/javascript"> //清空文件上传框,file为上传表单对像 function clearFileInput(file){ var form=document.createElement('form'); document.body.appendChild(form); //记住file在旧表单中 ![]() ![]() var pos=file.nextSibling; form.appendChild(file); form.re ![]() ![]() pos.parentNode.insertBefore(file,pos); document.body.removeChild(form); } </script> //把这个JS放到页面 ![]() <script language="javascript" type="text/javascript"> //清空文件上传框,file为上传表单对像 function clearFileInput(file){ var form=document.createElement('form'); document.body.appendChild(form); //记住file在旧表单中 ![]() ![]() var pos=file.nextSibling; form.appendChild(file); form.re ![]() ![]() pos.parentNode.insertBefore(file,pos); document.body.removeChild(form); } </script>view plaincopy to clipboardpr ![]() //添加按钮 ![]() ![]() ![]() ![]() ![]() ![]() btnCannel.OnClientClick = "clearFileInput(document.getElementById('" + 上传控件ID.ClientID + "'));" 1
相关文章读者评论发表评论 |