I am using below JS code to hide/remove duplicate values from a lookup column.
<script language="javascript" type="text/javascript"
src="https://code.jquery.com/jquery-1.11.3.min.js"></script>
<script type="text/javascript">
var previousOption;
$(document).ready(function() {
$('#Vendor_x0020_name').parent().next().find('select option').each(function() {
if (this.text == previousOption) $(this).remove();
previousOption= this.text;
});
});
</script>
The lookup column name is: Vendor Name and it has some duplicate values showing up in the drop-down. The same code works when added on the New item form in SPOnline list but doesn't work when added to new item form of SharePoint server 2013 list.
Can someone help,thanks.