Checkboxes check (with alert)

This commit is contained in:
Verena Schulz
2025-11-12 17:39:02 +01:00
parent d9e96316c0
commit a32e7e5744
2 changed files with 21 additions and 6 deletions
+1 -1
View File
@@ -38,7 +38,7 @@
</div> </div>
</div> </div>
<button class="submit-btn" id="submitButton">Submit</button> <button class="submit-btn" id="submitButton" onclick="checkBoxes()">Submit</button>
<div class="progressbar"> <div class="progressbar">
<div class="progress_fill"></div> <div class="progress_fill"></div>
+18 -3
View File
@@ -23,12 +23,27 @@ manualBtn.addEventListener('click', () => {
}); });
submitBtn.addEventListener('click', () => { //function to check if one checkbox is at least klicked
function checkBoxes() {
const checkboxes = document.querySelectorAll('input[name="docFormat"]');
let isChecked = false;
checkboxes.forEach(function(checkbox){
if(checkbox.checked){
isChecked = true;
}
});
if(isChecked){
//Code to submit the video
} else {
//language only english at the moment
alert('Please select at least one document type.');
}
// mapFunctions.get("extraction-video-to-audio").function({inputVideoPath:"./a.mp4", outputType:"wav"}) // mapFunctions.get("extraction-video-to-audio").function({inputVideoPath:"./a.mp4", outputType:"wav"})
}
}); //language changing feature
function changeLanguage(language) { function changeLanguage(language) {
if (language === 'en') { if (language === 'en') {
document.getElementById('title').textContent = 'Video to document'; document.getElementById('title').textContent = 'Video to document';