关于复选框 [英] regarding check box

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

问题描述

我在页面中有两个复选框。现在我想设置,你不能在两个时间打勾。如果你勾选一个复选框,那么另一个勾选。我是怎么做到的...请帮助我..

i have two check box in a page. now i want to set, u cant tick on both at a atime. if u tick on one check-box then another is tick off. how i do this..please help me..

推荐答案

http:// jsfiddle .net / 44Zfv / [ ^ ]



使复选框表现得像单选按钮 [ ^ ]



检查链接..希望它能帮到你..
http://jsfiddle.net/44Zfv/[^]

Make Checkbox behave like Radio button[^]

Check the links..hope it will help you..


尝试互斥CheckBox ajax控件

http://www.asp.net/ajaxLibrary/AjaxControlToolkitSampleSite/MutuallyExclusiveCheckBox/MutuallyExclusiveCheckBox.aspx [ ^ ]
Try Mutually Exclusive CheckBox ajax control
http://www.asp.net/ajaxLibrary/AjaxControlToolkitSampleSite/MutuallyExclusiveCheckBox/MutuallyExclusiveCheckBox.aspx[^]


你必须使用javascript来执行此操作。



在javascript代码中,您将编写代码来处理click事件并取消选中所有其他复选框。



如果您正在使用jQuery,然后你可以写:



You have to use javascript for doing this.

In the javascript code, you will write code to handle the click event and deselect all other checkbox.

If you are using jQuery, then you can write:


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

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