I have a form that retrieves data from a stored procedure and I would like to manipulate the data to remove the ending '||' characters when displaying the data. I have a function that is called onloadlookupfinished but this does not apply when the form is submitted and displayed. I need the form to display as it does onloadlookupfinished. Below is the code I have that is working, but need help with a script that will apply the change when the form is submitted.
$(document).on('onloadlookupfinished', function () {
$('#loadingscreen').hide();
var comment = $('.comm textarea').val();
comment = comment.replace(/[||]+$/, '');
//alert(comment);
$('.comm textarea').val(comment);
});
Display Correctly on load:
Default value is set to 'test || test ||' and I only want to remove the end set of '||'
After submission:
Thanks,
Nate