如何防止选择所选单选按钮 [英] how to prevent selection of a selected radio button
本文介绍了如何防止选择所选单选按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在我的页面中有两个单选按钮,它们允许选择和取消选择相同的单选按钮。我想阻止这个
In my page there are two radio buttons and they are allowing select and unselect of the same radio button. I want to prevent this
推荐答案
从问题看来,你一次只能选择1个RadioButton。
如果是这种情况,请使用 RadioButton.GroupName属性作为RadioButtonlist控件。
参考
http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.radiobutton.groupname(v = vs.110).aspx [ ^ ]
From the Question it seems you need to allow only 1 RadioButton to be selected at a time.
If thats the case, use RadioButton.GroupName Property for the RadioButtonlist Control.
Refer
http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.radiobutton.groupname(v=vs.110).aspx[^]
您可以对名称属性进行分组以使它们互斥。或者您可以使用单选按钮列表而不是两个单选按钮。
you can you group name property to make them mutually exclusive. or you can have radio button list instead of two radio button.
这篇关于如何防止选择所选单选按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文