如何选择所有的单选按钮和排除一个jquery
How to select all radio buttons and exclude one jquery
我有以下代码来检查单选按钮是否被值为true以显示名为FollowUp
的行。
showHideFollowup: function (e) {
e.preventDefault();
if ($("input[type='radio'][name='" + e.target.name + "']:checked").val() == "true") {
$(".questionRow" + e.target.name + "Followup").show();
}
else {
$(".questionRow" + e.target.name + "Followup").hide();
$(".questionRow" + e.target.name + "Followup input").val(null);
$(".questionRow" + e.target.name + "Followup textarea").val(null);
$(".questionRow" + e.target.name + "Followup input[type='radio']").prop("checked", null);
}
},
我想为所有值为true的单选按钮显示follow - up部分,除了一个。修改后,它没有显示任何单选按钮的followUp部分,因为它正在检查rbThisIsNotWorking是否为false。我怎样才能达到我所追求的?
if (($("input[type='radio'][name='" + e.target.name + "']:checked").val() == "true" && $('input:radio[name="#rbThisIsNotWorking"]:checked').val() == "false")) {
$(".questionRow" + e.target.name + "Followup").show();
}
我想你是在ism检查rbThisIsNotWorking
元素是否未检查
if ($("input:not(#rbThisIsNotWorking)[type='radio'][name='" + e.target.name + "']").is(':checked')) {
$(".questionRow" + e.target.name + "Followup").show();
} else {
$(".questionRow" + e.target.name + "Followup").hide();
$(".questionRow" + e.target.name + "Followup input").val(null);
$(".questionRow" + e.target.name + "Followup textarea").val(null);
$(".questionRow" + e.target.name + "Followup input[type='radio']").prop("checked", null);
}
相关文章:
- 对DataTable jquery进行排序,排除文本字段中的空白
- 非常奇怪的JS/jQuery行为-alert()包含/排除
- 使用下拉菜单排除jquery错误
- jQuery .not() 排除特定类的父类
- 使用 jQuery 创建可单击的行并排除子元素
- 从 jquery 中的滚动到动画中排除特定的 #
- 如何从jQuery中的函数中排除特定的标记
- jQuery输入值故障排除
- jQuery按数据值排除元素
- "如何使用jQuery's form.serialize但排除空字段"不起作用(使用php)
- jquery在通过ajax发送时将数据排除在对象之外
- jQuery:从 .text() 中排除子项
- 在 jquery UI 日期选取器中排除和禁用两个日期之间的差异中的假日
- Jquery 滚动函数排除可变高度
- 对使用 iframe 的简单 jquery 展开/折叠进行故障排除
- 排除 JQuery 轮播中的空白图像
- jQuery .hover 函数故障排除
- 对 jQuery 切换进行故障排除
- 如何排除jQuery复选框结果
- 排除jQuery事件中的兄弟事件