Three or four people gave solutions -- it's not hard to get an array of all checkbox objects and check or uncheck them programatically in JS -- but only one said "that's a terrible idea! Checkboxes are checkboxes and radio buttons are radio buttons. You will upset and confuse your users if you do this". That's a much better response than just telling them how to do it, because they've misunderstood something fundamental, or they wouldn't be asking.
- I often see on PerlMonks a kind of intermediate variety of this problem. It's not "how do I do (something stupid or dangerous or wasteful)" it's "I want to do (something quite sensible-sounding) and I've already determined that I'll do it such and such a way, and I'm stuck, please help me".
It's like someone's written "I want to get a screw into some wood, but my hammer's handle is slippery, what shall I use to make the hammer do the job better?" and you have to say that a screwdriver is the correct solution. And probably just as often, the person asking says "I want to fix two bits of wood with one of those metal things, which hammer should I use?" and you have to encourage them to explain whether it's a screw or a nail in a follow-up post.
Every bit of code is either naturally related to the problem at hand, or else it's an accidental side effect of the fact that you happened to solve the problem using a digital computer.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.
| & || & |
| < || < |
| > || > |
| [ || [ |
| ] || ] ||