开发者

How to clear HTML File Input field (while using fakeupload) in IE?

We are using this solution to style our "browse" buttons. However, when we use this technique, our "clear" button no longer works in IE. In other words, it doesn't remove the fakepath. Still works in Firefox and Chrome though.

<div id="upload_div">
  <li class="uploadlink">
    <div class="fakeupload">
     <input type="text" name="fakeupload" />
    </div>

  <input type="file" name="upload" id="uploadFile" class="realupload" onchange="this开发者_如何学运维.form.fakeupload.value = this.value;"/>     
  <input name="clearinput" type="button" value="Clear" onClick="clearFileInput('upload_div')">                
  </li> 
</div>

Clear button function:

function clearFileInput(tagId) { 
    document.getElementById(tagId).innerHTML = document.getElementById(tagId).innerHTML; 
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜