不可检查的RadioButtons vs独占复选框 [英] uncheckable RadioButtons vs exclusive Checkboxes

查看:102
本文介绍了不可检查的RadioButtons vs独占复选框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

从用户界面的角度来看,最好是有一组RadioButton,并且增加了可以取消选中的功能,或者拥有一组独立的CheckBox,意味着一次只能检查一个?



示例: http://jsfiddle.net/5fN2J/2/



更新:

。如果我给出的例子更接近它的使用方式,也许它会有所帮助。



我有一个GridView充满了数据绑定的东西。用户可以选择其中一行作为主,但这不是必需的。新的例子: http://jsfiddle.net/5fN2J/2/



我是否应该包含一个额外的控件来取消选中主要,或者只是扩展CheckBox或RadioButton的功能?



如果您认为额外的RadioButton,在标题中将会出现在哪里?



顺便说一句,看起来需要JavaScript才能使RadioButton在GridView中工作,因为ASP.Net可以消除GroupName。

解决方案

肯定使用单选按钮,因为它们是为了这个目的。为什么混淆用户与复选框,并进一步通过编写代码来维护排他性行为而烦恼自己?


From a UI prospective, is it better to have a set of RadioButtons with the added functionality of being able to uncheck, or have a set of exclusive CheckBoxes, meaning only one can be checked at a time?

Example: http://jsfiddle.net/5fN2J/2/

Update:

I did not expect such negative responses to this. Maybe it would help if I gave an example that is closer to how it's being used.

I have a GridView full of databound stuff. The user has the option of choosing one of the rows as "primary", but it's not required. new example:http://jsfiddle.net/5fN2J/2/

Should I include an extra control for unchecking the "primary", or just extend the functionality of the CheckBox or RadioButton ?

If you think extra RadioButton, where would that go, in the header?

BTW, it looks like JavaScript is needed to make RadioButtons work in a GridView anyway because of ASP.Net munging the GroupName.

解决方案

Definitely use radio buttons, as they are meant for this purpose. Why confuse the user with checkboxes and further trouble yourself by writing code to maintain exclusive behaviour?

这篇关于不可检查的RadioButtons vs独占复选框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆