I hope someone can help me out here.
I have a SharePoint list with a Choice type lookup field.
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 :
$('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!
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.