How reset filefield input in ExtJS? I am trying:
//this - point on Ext.panel.Form
var form = this.getForm();
form.reset();
var filefield = this.getForm().getFields().get(0);
filefield.reset();
filefield.setValue('');
filefield.value = '';
But not one of these methods don't work. Thank you for help!
Use below code will help you
function clearFileUpload(id){
    // get the file upload element
    fileField     = document.getElementById(id);
    // get the file upload parent element
    parentNod     = fileField.parentNode;
    // create new element
    tmpForm        = document.createElement("form");
    parentNod.replaceChild(tmpForm,fileField);
    tmpForm.appendChild(fileField);
    tmpForm.reset();
    parentNod.replaceChild(fileField,tmpForm);
}
                        If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With