Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!newsreader4.netcologne.de!news.netcologne.de!feeder1.cambriumusenet.nl!feed.tweaknews.nl!193.141.40.65.MISMATCH!npeer.de.kpn-eurorings.net!npeer-ng0.de.kpn-eurorings.net!newsfeed.arcor.de!newsspool2.arcor-online.net!news.arcor.de.POSTED!not-for-mail Content-Type: text/plain; charset="UTF-8" Message-ID: <337611277.18NyDrsYic@PointedEars.de> From: Thomas 'PointedEars' Lahn Reply-To: Thomas 'PointedEars' Lahn Organization: PointedEars Software (PES) Date: Tue, 16 Oct 2012 21:00:56 +0200 User-Agent: KNode/4.4.11 Content-Transfer-Encoding: 8Bit X-Face: %i>XG-yXR'\"2P/C_aO%~;2o~?g0pPKmbOw^=NT`tprDEf++D.m7"}HW6.#=U:?2GGctkL,f89@H46O$ASoW&?s}.k+&. Followup-To: comp.lang.javascript MIME-Version: 1.0 Lines: 50 NNTP-Posting-Date: 16 Oct 2012 21:00:56 CEST NNTP-Posting-Host: dce0755a.newsspool2.arcor-online.net X-Trace: DXC=WE3dk:b\iT?;]cDoEWD6A4A9EHlD;3Yc24Fo<]lROoR18kFK0MlUDQE;hSb4]BB91NYik`> X-Complaints-To: usenet-abuse@arcor.de Xref: csiph.com comp.lang.javascript:16668 Andrew Poulos wrote: > The user needs to select one or more items. I can't use radio button > sets because that limits you to only one selected item, but if I use > checkboxes it means users can have no selected items. > > My options are: > > 1. Use checkboxes and when the user submits the form tell them to make a > selection if no selection has been made. This seems the obvious choice > but I'd rather solve the problem with design rather than message boxes. You can and should mark obvious errors in the form *before* the form has been submitted. The "message box" could then be limited to a friendly reminder in the document. > 2. Use checkboxes and don't let the user uncheck the last checked > checkbox in the set. This means that a checkbox may not behave as > expected. You could record the first unchecked/checked checkbox and check/uncheck that when a third checkbox is about to be unchecked/checked. However, it is probably best to display a message explaining why selecting no item or too many items does not make sense, if and when the user tried to do that. And to prevent submission of the form when an obviously erroneous form is about to be submitted, and explaining – by marking the errors – why submitting it has failed. > Or is there some other control that I can create/design that is > intuitive to use to achieve the same thing? There is also But if your users are using a pointing device, they will probably need a keyboard also, in particular the Ctrl/Cmd or Space key. So this is not as accessible as the solution above, maybe not as intuitive and could well be considered overkill for a short list of options. PointedEars -- > If you get a bunch of authors […] that state the same "best practices" > in any programming language, then you can bet who is wrong or right... Not with javascript. Nonsense propagates like wildfire in this field. -- Richard Cornford, comp.lang.javascript, 2011-11-14