how to clear the textbox value of asyncfileupload ..?

Amit picture Amit · Nov 28, 2009 · Viewed 13.2k times · Source

There is one button(MyButton). OnClick of this button a modalpopup(MyPopup) appears with one asyncfileupload ajax control, Ok button and Cancel button.

The browse functionality of the asyncfileupload functionality is working fine, No problem. But after postback, if I click the MyButton again, the popup appearing with the previous path in the asyncfileupload control's textbox.

How to clear it ... !

Thanks in advance.

Answer

ador-mg picture ador-mg · Nov 6, 2012

None of the proposed ways worked for me. The problem is not specific to AsyncFileUpload, but to the input[type=file].

Finally, I found a way that worked for me with javascript:

function uploadComplete(sender, args) {
    jQuery(sender.get_element()).find("input[type='file']")[0].form.reset();
}