'How to check if Checkboxes and ranges are checked/set to max?

here you can see what I want to implement

Hey I'm stuck at this: I want that the launch button gets enabled after all checkboxes are checked and all ranges are set to max. But something like this won't work:

while(checkboxes.unchecked && ranges.value !== '100') {
    if (checkboxes.checked && ranges.value == '100') 
        document.getElementById('launch').disabled = false;
}

Any tipps for implementation?



Solution 1:[1]

Try this approach :

You need to iterate over all checkbox elements as well as range elements.

Then use a flag variable to verify if all checkboxes/ranges are checked/max.

Use onchange/oninput event handlers. -> while loop is not necessary

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Nanthakumar J J