I am using jQuery File Upload plugin here for uploading files.
For each file that is added I generate a row in the table with a hidden button (that would be the single u
The following code binds the event to all buttons with the name "singleUploadFile".
$('button[name="singleUploadFile"]').click(function () {
if (data.files.length > 0) {
data.submit();
addedFiles += 1;
}
});
But you want it to bind the event just to the newly added button (not to buttons that already have it bound).
Do the following:
data.context.find('button[name="singleUploadFile"]').click(function () {
if (data.files.length > 0) {
data.submit();
addedFiles += 1;
}
});