Skip to content

Instantly share code, notes, and snippets.

@JwanKhalaf
Created January 30, 2020 15:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JwanKhalaf/9e00aa9cdecb580990d13c687be92897 to your computer and use it in GitHub Desktop.
Save JwanKhalaf/9e00aa9cdecb580990d13c687be92897 to your computer and use it in GitHub Desktop.
let formData = new FormData(document.querySelector('#request-for-change-form'));
console.log(selectedFiles);
for (var i = 0; i < selectedFiles.length; i++) {
formData.append("files[]", selectedFiles[0]);
}
console.log(formData.getAll('files[]'));
$("#request-for-change-form").submit();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment