Good day everyone. I have the following problem:
I need to check if the form with input (type is file) is ready to submit (file upload must be completed). I tried to check if the file is uploaded by JQuery function: fileupload('active'), but I received this error: Uncaught TypeError: fileInput.fileupload is not a function.
The code is here:
for (let i = 0; i < fileForms.length; i++) {
var subFormInput = document.createElement("input");
subFormInput.setAttribute("type", "hidden");
subFormInput.setAttribute("name", "submittedFormId");
subFormInput.setAttribute("value", response.submittedFormId);
fileForms[i].appendChild(subFormInput);
i=0;
fileInput = fileForms[i].querySelector('input[name="answer"]');
console.log(fileInput);
while (fileInput.fileupload('active') > 0) {
i++;
}
fileForms[i].submit();
}