1

enter image description here

after i click 'Cancel' the file is still stuck there. in explorer it works but in chrome i could not find any way to clear the input file. the code is: enter image description here Please any help!!

Here is my code :

var AddFileWindow = $('#AddFileWindow').kendoWindow({
    title: 'Add File',
    visible: false,
    modal: true,
    width: 440,
    height: 450,
    resizable: false,
    actions: [
        "Close"
    ],
    activate: function () {
        $('#AddFileWindow').show();
    },
    close: function (e) {
        clearAddFileWindow();
    }
}).data('kendoWindow');

    function clearAddFileWindow() {
         var fileInput = $('#frame-files');
         fileInput.replaceWith(fileInput.val(''));
         $("#machine-file").data("kendoDropDownList").select(0);
         $("#material-file").data("kendoDropDownList").select(0);

         document.getElementById("material-group").style.display = "none";
         document.getElementById("alert").style.display = "none";
         document.getElementById("Notes-file").value = ""; 
        }

    <div id="AddFileWindow" style="display:none;">
                <div class='k-edit-label'>
                    <div class="form-horizontal form-widgets col-sm-10" style="margin-left:15px;">
                        <div class="form-group">
                            <div class="fileinput fileinput-new input-group" data-provides="fileinput" style="margin-top:10px">
                                <div class="form-control"><i class="fa fa-file-text-o fileinput-exists"></i> <span class="fileinput-filename"></span></div>
                                <span class="input-group-addon btn btn-primary btn-file">
                                    <span class="fileinput-new">Select file</span><span class="fileinput-exists">Change</span>
                                    <input id="frame-files" style="height:70px" type="file" name="...">
                                </span>
                                <a href="#" class="input-group-addon btn btn-primary fileinput-exists" data-dismiss="fileinput">Remove</a>
                            </div>
                        </div>
                    </div>
braX
  • 11,506
  • 5
  • 20
  • 33
user4810410
  • 31
  • 1
  • 5

0 Answers0