开发者

Checkbox behaving as radiobox [duplicate]

开发者 https://www.devze.com 2023-02-04 03:25 出处:网络
This question already has answers here: Closed 12 years ago. Possible Duplicate: jQuery: make checkboxes act like radio buttons?开发者_如何学Go
This question already has answers here: Closed 12 years ago.

Possible Duplicate:

jQuery: make checkboxes act like radio buttons? 开发者_如何学Go

Hey All,

Im looking to make some checkboxes act like radio buttons.

For example, i have the following code:

<input type="checkbox" name="xhtml" value="B" />
<input type="checkbox" name="xhtml" value="I" />
<input type="checkbox" name="xhtml" value="A" />

The problem is that i can select all three of them, i only want to be able to select one out of the 3.

I know its easier to change to radio buttons, but i have to use checkboxes for this project.

Cheers,


Use jQuery. See: http://blog.schuager.com/2008/09/mutually-exclusive-checkboxes-with.html

0

精彩评论

暂无评论...
验证码 换一张
取 消