【发布时间】:2012-08-05 22:11:22
【问题描述】:
我已经四处搜索并找到了多个答案,但没有一个对我有用。 我在中继器控件中使用 RadioButtonList。这是我的 jQuery 函数。
$("[name$='$PlanSelectionRbtnLst']").click(function () {
alert($(this).val()); //this works
$("[name$='$PlanSelectionRbtnLst']").find("input[value='-1']").attr("checked", true); // this doesn't
});
当我单击任何单选按钮时,这会正确提醒我选择的值,但我无法将 RadioButtonList 的所有选定按钮更改为 -1 值。如果重要的话,我的脚本在母版页中。
编辑:根据要求,这里是渲染 html 的小 sn-p:
<table id="MainContent_BenefitsRpt_PlanSelectionRbtnLst_2>
<tbody>
<tr>
<td>
<input name="ct100$MainContent$BenefitsRpt$ct103$PlanSelectionRbtnList" id="MainContent_BenefitsRpt_PlanSelectionRbtnLst_2_0_2" type="radio" value="9"/>
</td>
<tr>
</tbody>
【问题讨论】:
-
发布与上述代码相关的 HTML
标签: jquery