Function to hide table cells depending on whether checkbox is checked or not
Can anyone see what I have done wrong? (probably something stupid, I'm new to this stuff)
I haven't copied and attempted to run your code, but the "checked" property for an inbox element is a boolean rather than an integer. Perhaps "1" can substitute for "true,"--I don't know. But instead of "if (check.checked == 1)" you might put "if (check.checked === true)," and don't put any quotes around true.
On the other hand: the "hiding" (by visibility or by display) of a form's element (or its parent node) does not mean, automatically, that the element will not submit its value (if any) onsubmit. When you try to hide a form's element, make sure it is also disabled at the same time.