简体   繁体   English

共享点多值查找值

[英]Sharepoint Multiple Value Lookup Value

I hope someone can help me out here. 我希望有人可以在这里帮助我。

I have a SharePoint list with a Choice type lookup field. 我有一个带有选择类型查找字段的SharePoint列表。

I'm able to retrieve the selected value with the code below. 我可以使用以下代码检索所选的值。

 $("select[title='My field name']").change(function() { alert($(this).val()); } ); 

However this won't work when the field is set to "Allow multiple value". 但是,当字段设置为“允许多个值”时,此方法将无效。

If this options is enabled instead of the drop-down box an add/remove option is displayed. 如果启用了此选项而不是下拉框,则会显示添加/删除选项。 How can I get the selected value in this case? 在这种情况下,如何获得所选值?

Any help would be appreciated. 任何帮助,将不胜感激。

在此处输入图片说明

您需要尝试此代码。

$(this).options[$(this).selectedIndex].value

The change function is not getting fired when using multiple values Lookup field. 使用多个值“查找”字段时,不会触发更改功能。 Try to use "dblclick" event : 尝试使用“ dblclick”事件:

$('select[Title = "SelectTitle"] option').dblclick(function() {
   alert( "Handler for .dblclick() called." );
});

otherwise, you can add a click event to the "Add" button. 否则,您可以将点击事件添加到“添加”按钮。

Hope this help! 希望有帮助!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM