182
rated 0 times
[
186]
[
4]
/ answers: 1 / hits: 34055
/ 13 Years ago, mon, august 8, 2011, 12:00:00
I have an file upload box and a clear button on my page. When I press the clear button, I want the text in the file upload box to be cleared.
The following works in Firefox, but doesn't in IE (the text stays there). Is there a workaround for this?
$(#clear).click( function() {
$(#attachment).val();
//document.myform.attachment.value = ;
})
HTML:
<form name=myform>
<input type=file name=attachment id=attachment />
</form>
<br /><button id=clear>Clear Attachment</button>
More From » jquery