fix: remove required attr from file input when existing video is selected
This commit is contained in:
1 parent
d353272a0b
commit
42c80fd0fc
1 file changed
+5
-2
+5
-2
@@ -273,10 +273,8 @@
|
||||
form.addEventListener('submit', function () {
|
||||
if (videoPathInput.value) {
|
||||
form.action = '/upload/reuse';
|
||||
fileInput.removeAttribute('required');
|
||||
} else {
|
||||
form.action = '/upload';
|
||||
fileInput.setAttribute('required', '');
|
||||
}
|
||||
submitBtn.disabled = true;
|
||||
submitBtn.textContent = 'Starting...';
|
||||
@@ -292,6 +290,11 @@
|
||||
submitHint.textContent = enabled
|
||||
? 'Ready to start analysis.'
|
||||
: 'Select a video and at least one model to begin.';
|
||||
if (selectedExistingVideo) {
|
||||
fileInput.removeAttribute('required');
|
||||
} else if (fileInput.files && fileInput.files.length === 0) {
|
||||
fileInput.setAttribute('required', '');
|
||||
}
|
||||
}
|
||||
|
||||
/* ------------------------------------------------
|
||||
|
||||
Reference in new issue
Block a user