gpt4 book ai didi

jquery - 当在共享点中选择下拉列表中的选项时,需要 jquery 代码来禁用单选按钮

转载 作者:行者123 更新时间:2023-12-01 04:26:03 24 4
gpt4 key购买 nike

我正在使用 moss 2007。我创建了一个下拉列,其中有 3 个选项。如果选择了选项 1 和选项 2,则应禁用单选按钮列;如果选择了选项 3,则应启用单选按钮列。我提供了页面源代码,因为我是 jquery 的新手,有人可以帮我解决这个问题吗?

<TR>
<TD nowrap="true" valign="top" width="190px" class="ms-formlabel"><H3 class="ms-standardheader">
<nobr>Type of Notification</nobr>
</H3></TD>
<TD valign="top" class="ms-formbody" width="400px">
<!-- FieldName="Type of Notification"
FieldInternalName="Type_x0020_of_x0020_Notification"
FieldType="SPFieldChoice"
-->
<span dir="none"><select name="ctl00$m$g_785c653c_cfa1_4aa5_8060_a84901274cc3$ctl00$ctl04$ctl07$ctl00$ctl00$ctl04$ctl00$DropDownChoice" id="ctl00_m_g_785c653c_cfa1_4aa5_8060_a84901274cc3_ctl00_ctl04_ctl07_ctl00_ctl00_ctl04_ctl00_DropDownChoice" title="Type of Notification" class="ms-RadioText">
<option selected="selected" value="Select One">Select One</option>

<option value="Option1">Option1</option>
<option value="Option2">Option2</option>
<option value="Option3">Option3</option>

</select><br></span></TD></TR>

<TR>
<TD nowrap="true" valign="top" width="190px" class="ms-formlabel"><H3 class="ms-standardheader">
<nobr>Does this position have direct reports</nobr>
</H3></TD>
<TD valign="top" class="ms-formbody" width="400px">
<!-- FieldName="Does this position have direct reports"
FieldInternalName="Does_x0020_this_x0020_position_x0"
FieldType="SPFieldChoice"
-->
<span dir="none"><table cellpadding="0" cellspacing="1">
<tr>
<td><span class="ms-RadioText" title="Yes"><input id="ctl00_m_g_785c653c_cfa1_4aa5_8060_a84901274cc3_ctl00_ctl04_ctl09_ctl00_ctl00_ctl04_ctl00_ctl00" type="radio" name="ctl00$m$g_785c653c_cfa1_4aa5_8060_a84901274cc3$ctl00$ctl04$ctl09$ctl00$ctl00$ctl04$ctl00$RadioButtons" value="ctl00" /><label for="ctl00_m_g_785c653c_cfa1_4aa5_8060_a84901274cc3_ctl00_ctl04_ctl09_ctl00_ctl00_ctl04_ctl00_ctl00">Yes</label></span></td>
</tr><tr>
<td><span class="ms-RadioText" title="No"><input id="ctl00_m_g_785c653c_cfa1_4aa5_8060_a84901274cc3_ctl00_ctl04_ctl09_ctl00_ctl00_ctl04_ctl00_ctl01" type="radio" name="ctl00$m$g_785c653c_cfa1_4aa5_8060_a84901274cc3$ctl00$ctl04$ctl09$ctl00$ctl00$ctl04$ctl00$RadioButtons" value="ctl01" checked="checked" /><label for="ctl00_m_g_785c653c_cfa1_4aa5_8060_a84901274cc3_ctl00_ctl04_ctl09_ctl00_ctl00_ctl04_ctl00_ctl01">No</label></span></td>
</tr>
</table></span></TD></TR>

<TR>
<TD nowrap="true" valign="top" width="190px" class="ms-formlabel"><H3 class="ms-standardheader">
<nobr>Spectris Approver</nobr>
</H3></TD>
<TD valign="top" class="ms-formbody" width="400px">
<!-- FieldName="Spectris Approver"
FieldInternalName="Spectris_x0020_Approver"
FieldType="SPFieldChoice"
-->
<span dir="none"><table cellpadding="0" cellspacing="1">
<tr>
<td><span class="ms-RadioText" title="Yes"><input id="ctl00_m_g_785c653c_cfa1_4aa5_8060_a84901274cc3_ctl00_ctl04_ctl19_ctl00_ctl00_ctl04_ctl00_ctl00" type="radio" name="ctl00$m$g_785c653c_cfa1_4aa5_8060_a84901274cc3$ctl00$ctl04$ctl19$ctl00$ctl00$ctl04$ctl00$RadioButtons" value="ctl00" /><label for="ctl00_m_g_785c653c_cfa1_4aa5_8060_a84901274cc3_ctl00_ctl04_ctl19_ctl00_ctl00_ctl04_ctl00_ctl00">Yes</label></span></td>
</tr><tr>
<td><span class="ms-RadioText" title="No"><input id="ctl00_m_g_785c653c_cfa1_4aa5_8060_a84901274cc3_ctl00_ctl04_ctl19_ctl00_ctl00_ctl04_ctl00_ctl01" type="radio" name="ctl00$m$g_785c653c_cfa1_4aa5_8060_a84901274cc3$ctl00$ctl04$ctl19$ctl00$ctl00$ctl04$ctl00$RadioButtons" value="ctl01" checked="checked" /><label for="ctl00_m_g_785c653c_cfa1_4aa5_8060_a84901274cc3_ctl00_ctl04_ctl19_ctl00_ctl00_ctl04_ctl00_ctl01">No</label></span></td>
</tr>
</table></span></TD>
</TR>

问候SP.D

最佳答案

$(document).ready(function(){
$('.ms-RadioText').change(function(){
var opt = $(this).val();
if(opt == 'Option1' || opt == 'Option2'){
$('input:radio').attr('disabled', 'disabled');
} else{
$('input:radio').removeAttr('disabled');
}
});
});

Check it here »

关于jquery - 当在共享点中选择下拉列表中的选项时,需要 jquery 代码来禁用单选按钮,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6442854/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com