我是Jquery的新手,目前正在使用Sharepoint列表。这里有一种情况是禁用另一个单选按钮列中选中选项的单选按钮列。 单选按钮column1和单选按钮column2每个都有两个选项。如果在单选按钮列1中选择了选项2,则应禁用整个单选按钮列2。下面是我对使用jquery禁用另一个单选按钮上的单选按钮列
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js">
</script>
<script language="JavaScript">
$(document).ready(function()
{
$('input[name=Who will be developing the propose site?]').change(function(){
if($(this).val() == 'Site Adminstrator')
{
$('input[name=Has site administrator attest to development operations of Rules of Road]').prop('disabled',true);
}
else
{
$('input[name=Has site administrator attest to development operations of Rules of Road]').prop('disabled',false);
}
});
});
</script>
下面工作的代码为页(SharePoint列表)中的SharePoint源代码
<TR><TD nowrap="true" valign="top" width="190px" class="ms-formlabel"><H3 class="ms-standardheader">
<nobr>Who will be developing the propose site?</nobr>
</H3></TD>
<TD valign="top" class="ms-formbody" width="400px">
<!-- FieldName="Who will be developing the propose site?"
FieldInternalName="Who_x0020_will_x0020_be_x0020_de"
FieldType="SPFieldChoice"
-->
<span dir="none"><table cellpadding="0" cellspacing="1">
<tr>
<td><span class="ms-RadioText" title="CSMS"><input id="ctl00_m_g_7d3ef79b_83fe_4a1f_a469_42a8746f064e_ctl00_ctl04_ctl07_ctl00_ctl00_ctl04_ctl00_ctl00" type="radio" name="ctl00$m$g_7d3ef79b_83fe_4a1f_a469_42a8746f064e$ctl00$ctl04$ctl07$ctl00$ctl00$ctl04$ctl00$RadioButtons" value="ctl00" checked="checked" /><label for="ctl00_m_g_7d3ef79b_83fe_4a1f_a469_42a8746f064e_ctl00_ctl04_ctl07_ctl00_ctl00_ctl04_ctl00_ctl00">CSMS</label></span></td>
</tr><tr>
<td><span class="ms-RadioText" title="Site Administrator"><input id="ctl00_m_g_7d3ef79b_83fe_4a1f_a469_42a8746f064e_ctl00_ctl04_ctl07_ctl00_ctl00_ctl04_ctl00_ctl01" type="radio" name="ctl00$m$g_7d3ef79b_83fe_4a1f_a469_42a8746f064e$ctl00$ctl04$ctl07$ctl00$ctl00$ctl04$ctl00$RadioButtons" value="ctl01" /><label for="ctl00_m_g_7d3ef79b_83fe_4a1f_a469_42a8746f064e_ctl00_ctl04_ctl07_ctl00_ctl00_ctl04_ctl00_ctl01">Site Administrator</label></span></td>
</tr>
</table></span></TD></TR>
<TR><TD nowrap="true" valign="top" width="190px" class="ms-formlabel"><H3 class="ms-standardheader">
<nobr>Has site administrator attest to development operations of Rules of Road</nobr>
</H3></TD>
<TD valign="top" class="ms-formbody" width="400px">
<!-- FieldName="Has site administrator attest to development operations of Rules of Road"
FieldInternalName="Has_x0020_site_x0020_administrat"
FieldType="SPFieldChoice"
-->
<span dir="none"><table cellpadding="0" cellspacing="1">
<tr>
<td><span class="ms-RadioText" title="Yes"><input id="ctl00_m_g_7d3ef79b_83fe_4a1f_a469_42a8746f064e_ctl00_ctl04_ctl08_ctl00_ctl00_ctl04_ctl00_ctl00" type="radio" name="ctl00$m$g_7d3ef79b_83fe_4a1f_a469_42a8746f064e$ctl00$ctl04$ctl08$ctl00$ctl00$ctl04$ctl00$RadioButtons" value="ctl00" checked="checked" /><label for="ctl00_m_g_7d3ef79b_83fe_4a1f_a469_42a8746f064e_ctl00_ctl04_ctl08_ctl00_ctl00_ctl04_ctl00_ctl00">Yes</label></span></td>
</tr><tr>
<td><span class="ms-RadioText" title="No"><input id="ctl00_m_g_7d3ef79b_83fe_4a1f_a469_42a8746f064e_ctl00_ctl04_ctl08_ctl00_ctl00_ctl04_ctl00_ctl01" type="radio" name="ctl00$m$g_7d3ef79b_83fe_4a1f_a469_42a8746f064e$ctl00$ctl04$ctl08$ctl00$ctl00$ctl04$ctl00$RadioButtons" value="ctl01" /><label for="ctl00_m_g_7d3ef79b_83fe_4a1f_a469_42a8746f064e_ctl00_ctl04_ctl08_ctl00_ctl00_ctl04_ctl00_ctl01">No</label></span></td>
</tr>
</table></span></TD></TR>
任何帮助或代码的修改是非常有帮助的
亲切的问候 BK
您可能需要查看一些为使用Sharepoint而创建的javascript/jquery库。访问Sharepoint页面上的元素是一个巨大的痛苦。 –