Skip to content
Advertisement

Javascript: Detect checked boxes isn’t working with form with only 1 checkbox. Working with 2 or more

I have the function below. It gets the values from checked boxes and transfer it to a textbox. It is working… but only if the form has 2 or more checkboxes.

JavaScript

Am I missing something to make this work with only 1 checkbox?

Advertisement

Answer

When there is one item. it does not return array

JavaScript
User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement