SharePoint 2013表单(隐藏字段) [英] SharePoint 2013 Form (Hide Field)
本文介绍了SharePoint 2013表单(隐藏字段)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个infopath表单,用于SP2013中的帮助台解决方案。我在InfoPath表单上有一个名为"Tech Notes"的部分。我想为那些不属于IMOGroup的用户隐藏该部分。 javascript可以隐藏表单中
infopath部分的字段吗?请指教。我试过以下,但没有运气。
I have an infopath form that is used for a Helpdesk solution in SP2013. I have a section on the InfoPath form named "Tech Notes" I would like to hide that section for users that are not part of the IMOGroup. Can a javascript hide the field on the infopath section in the form? Please advise. I tried the following, but no luck.
<script type="text/javascript">
$(document).ready(function () {
$("Select[title$='Tech_x0020_Notes']").closest('tr').hide();
$("textarea[title$='Tech_x0020_Notes']").parent('span').parent('td').parent('tr').hide();
$("Select[title$='Tech_x0020_Notes']").closest('tr').hide();
$("[title$='Tech_x0020_Notes']").closest('tr').hide();
$().SPServices({
operation: "GetGroupCollectionFromUser",
userLoginName: $().SPServices.SPGetCurrentUser(),
async: false,
completefunc: function (xData, Status) {
if (($(xData.responseXML).find("Group[Name='IMOMembers']").length == 1)) {
$("Select[title$='Tech_x0020_Notes']").closest('tr').show();
$("textarea[title$='Tech_x0020_Notes']").parent('span').parent('td').parent('tr').show();
$("Select[title$='Tech_x0020_Notes']").closest('tr').show();
$("[title$='Tech_x0020_Notes']").closest('tr').show();
}
}
});
});
</script>
Lee Mossolle
Lee Mossolle
推荐答案
Hi Lee,
Hi Lee,
以下代码供您参考。
<script src="https://code.jquery.com/jquery-1.12.4.min.js" type="text/javascript"></script>
<script type="text/javascript">
(function(){
(function () {
(" td> h4> ; span:contains('Tech Notes')")。nearest('tr')。hide();
("td>h4>span:contains('Tech Notes')").closest('tr').hide();
这篇关于SharePoint 2013表单(隐藏字段)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文