I am setting up a function known as insertQuestion where it appends table rows. I also have a startVideoUpload() function where it starts the uploading and a stopVideoUpload() function where it stops the file upload.
Now I mentioned in those functions that if the uploading is happening, disable the Upload buttons, if the uploading has stopped then remove the disable from the Uplod buttons. Now what I want to do is that if the user appends a row while a file is uploading, then I want the
Upload buttons that have been appended to be disabled, else if the upload has stopped when the row is appended, then remove the disable from the Upload button.
My question is that is it possible to do this be checking in the insertQuestion() function that if a file is uploading (if statement if startVideoUpload() is true) then disable Upload button else if no file is uploading (if statement if stopVideoUpload() is true) then remove disable from Upload buttons. If this
can be done then how can the if statements be correctly coded to check if those functions are met?
Below is function where it would append rows (I have left it empty)
function insertQuestion(form) {
}
Below is relevant code where when it starts the file’s uploading process
function startVideoUpload(videouploadform){
sourceVideoForm = videouploadform;
$(".sbtnvideo").attr("disabled", "disabled");
});
return true;
}
Below is relevant code for function when uploading has finished:
function stopVideoUpload(success, videoID, videofilename){
$(".sbtnvideo").removeAttr("disabled");
return true;
}
You’ll need some sort of flag, indicating whether a video is currently being uploaded. Then, just check that from within your
insertQuestionfunction.