带单选按钮的多项选择 [英] Multiple Selections with Radio Buttons

查看:51
本文介绍了带单选按钮的多项选择的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要允许一个以上的选择,例如,一个用户可以选择三个选项,或者只能选择两个或一个:这仅允许一个,对吗?:

I need to permit more than one selection, for example one user can choose the three options or only two or one: This only permit one, correct?:

<input type="radio" name="group1" value="Milk" class="semLargura" /> Milk <br />
<input type="radio" name="group1" value="Butter" class="semLargura" /> Butter <br />
<input type="radio" name="group1" value="Cheese" class="semLargura" /> Cheese <br />

这允许3个选项

<input type="radio" name="group1" value="Milk" class="semLargura" /> Milk <br />
<input type="radio" name="group2" value="Butter" class="semLargura" /> Butter <br />
<input type="radio" name="group3" value="Cheese" class="semLargura" /> Cheese <br />

但是在这种情况下,我如何删除选择?例如,我选择牛奶",黄油"和奶酪",但是我要在选择后删除黄油.像是重置"按钮.

But in this case, how i can delete a select? For example i choose Milk, Butter and Cheese, but i want to remove the Butter after selected. Something like reset button.

推荐答案

为什么不使用复选框而不是单选按钮?它们完全按照您想要的方式工作...

Why don't you use checkboxes instead of radiobuttons? They work exactly the way you want...

这篇关于带单选按钮的多项选择的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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