Hi ,
I am working with Kendo UI version 2017.3.913 for Jquery and using kendoUpload widget,the issue I am encountering is whenever I am selecting a file/files from explorer window which opens after clicking "Select file",the "input" DOM element of kendoUpload is created again and hence I am having multiple duplicated DOM "Input" elements with same id/name,hence is causing the issues with desired functionality of the project as I want to register a click handler on the kendoUpload widget.I am using the widget inside a window.Overall issue is very similar to the existing thread : http://www.telerik.com/forums/one-file-selection-causes-multiple-instances-are-created ,one difference being in my case the Input DOM element is getting created multiple times on the UI/Client side only,but the call of uploading documents is going exactly once(which is expected and right behaviour).
HTML:
<form enctype="multipart/form-data" id='_duFrmdocForm_' action='uploadDoc' method='POST' enctype="multipart/form-data">
<span>
<div style="display: none">
<input id="_ignore" name="_Ignore" />
</div>
</span> <span>
<div style="display: none">
<input id="action" name="Action" />
</div>
</span> <span>
<div style="display: none">
<input id ="data" name="Data" />
</div>
</span>
<input id="duFiles" name="files[]" type="file" aria-label="files" />
</form>
Initialization code :
$('#duFiles').kendoUpload({
async : {
"saveUrl" : "uploadDoc",
"autoUpload" : false,
"batch" : true
},
upload : function(e) {
var data = {};
var payloadData = {
"test" : "abc"
};
$('#data')).val(JSON.stringify(payloadData));
var form = $('#duFrmdocForm')).serializeArray();
$.each(form, function() {
data[this.name] = this.value;
});
e.data = data;
}
});