Skip to content

Commit

Permalink
Merge pull request #1 from draj1010/draj1010-multiform
Browse files Browse the repository at this point in the history
Append random string on form id
  • Loading branch information
draj1010 authored Nov 3, 2020
2 parents 595fe14 + ad643d3 commit 291ddcb
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion js/jquery.uploadfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@

this.fileCounter = 1;
this.selectedFiles = 0;
var formGroup = "ajax-file-upload-" + (new Date().getTime());
var formGroup = "ajax-file-upload-" + (new Date().getTime()) + random_str_gen(9);
this.formGroup = formGroup;
this.errorLog = $("<div></div>"); //Writing errors
this.responses = [];
Expand Down Expand Up @@ -537,6 +537,16 @@
}
}

function random_str_gen(length) {
var result = '';
var characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
var charactersLength = characters.length;
for ( var i = 0; i < length; i++ ) {
result += characters.charAt(Math.floor(Math.random() * charactersLength));
}
return result;
}

function createCustomInputFile (obj, group, s, uploadLabel) {

var fileUploadId = "ajax-upload-id-" + (new Date().getTime());
Expand Down

0 comments on commit 291ddcb

Please sign in to comment.