There is something in this javascript or html which is is allowing the checkboxes to be ticked but for not even half a second. (I need the checks to stay there!) I also need the
You are using i = 0
rather than var i = 0
, which will introduce a global variable. This could be a problem if you're writing similar code elsewhere.
Your if
-statements are not statements at all. They look like pseudo-code. You're also comparing with =
rather than ==
, which will cause an assignment rather than a condition, even if you fix up your syntax.
You are not properly indenting your code, which will make you much more prone to introduce new errors.
These are the general issues I notice immediately. Of course, heaps of things could be wrong with this code. fields
might not be an array, computer
and selected
might not match the size of fields
, etc.
If you have any specific problem, please describe that, and we may be able to address it.