When I select a name from dropdown where it has an apostrophe Example: Brian O'Connar
My JS code will bring Brian O and rest of the characters after apostrophe gets cuts.
My Original JS code to load the data --
else if(newClaimCols[key]== "assigned_to_full_name_primary") {
var selectedText =$("#claim" + newClaimCols[key] + "filter").val()
//Brian O
if (selectedText!==null && selectedText!=="" ) {
var temp1 = $("#claim" + newClaimCols[key] + "filter").val();
for (var key in temp1) {
temp.push(temp1[key]);
}
}
}
In above case .val() selects only the text before apostrophe
2nd case I tried .text() please refer below code
else if (newClaimCols[key] == "assigned_to_full_name_primary") {
var selectedText = $("#claim" + newClaimCols[key] + "filter option:selected").text();//Brian O'Connar
if (selectedText!==null && selectedText!=="" ) {
var temp1 =$("#claim"+newClaimCols[key]+ "filter option:selected").text();
temp.push(temp1);
}
}
In this case i am getting Brian O'Connar but if i select multiple names Brian O'Connar and Nishinoya'O in dropdown it comes like
Example: Brian O'ConnarNishinoya'O
not sure how to handle this.
Please let me know how can i completely load the name with the apostrophe or a solution for 2nd case .text() when multiple name gets selected.