隐藏或显示比较Sharepoint列表中其他两个字段的字段

时间:2017-09-22 20:02:15

标签: javascript jquery sharepoint

我有两个人选择器列,名为Current User and Issue Owner。基于两个人选择器列之间的比较,我想要第三个字段隐藏/显示。如果人物选择器列具有相同的值,我需要显示它,否则隐藏它。 我在这做错了什么?

<script src="/sites/risk/Style%20Library/jquery-3.1.1.min.js"></script><script src="/sites/risk/Style%20Library/sputility.min.js"></script><script>

//$(document).ready(function(){

 var currentuser = SPUtility.GetSPField('Current User');
 var issueowner = SPUtility.GetSPField('Issue Owner');

 var HideOrShowOthersField=function(){
 var currentuserValue = currentuser.GetValue();
 var issueownerValue = issueowner.GetValue();

 if(currentuserValue!=issueownerValue)
 {

 SPUtility.GetSPField('Issue Owner Review Status').Hide();

 }
 else
 {


 SPUtility.GetSPField('Issue Owner Review Status').Show();

 }
 };
 HideOrShowOthersField();
 });
</script>

0 个答案:

没有答案