I have a dropdown that populates via a lookup. The value is two-part: a "friendly" name and a username, separated by a pipe '|' character. Because we want the user to see the friendly name, but the system to see the username, we use the following javascript to separate the parts into "value" and "display" categories:
$(document).ready(function () {
$('.choice-value-dropdown select').prop('disabled',true);
$(document).on('lookupcomplete', function(event){
$('.User_Select option').each(function(){
let text = $(this).text().split('|');
$(this).text(text[0]);
$(this).val(text[1]);
});
$('.choice-value-dropdown select').prop('disabled',false);
});
});
The script was working perfectly, and I frankly have no idea why it's not working now. As I step through in the browser debugger, I can see it working properly; the username portion gets assigned as the value, the friendly name as the text. At the completion of the javascript function, everything is looking good. Yet, when I let the page finish loading, suddenly the "value" attribute in the html is empty.
We are using Laserfiche v10.4
I haven't been able to make heads or tails of this issue, here's hoping one of you clever folks out there has an answer!