1
votes

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.

enter image description here

2

2 Answers

0
votes

You need to try this code.

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

0
votes

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!