1

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

WhiteHat
  • 59,912
  • 7
  • 51
  • 133
user643097
  • 127
  • 2
  • 15

2 Answers2

1

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!

soukaouta
  • 11
  • 3
0

You need to try this code.

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

GAMITG
  • 3,810
  • 7
  • 32
  • 51
WhiteHat
  • 59,912
  • 7
  • 51
  • 133