Hi Plumsail,
I have a drop down field which contains an item with an ampersand "Clinical & Scientific Services". When I select the item from the drop down to filter the list and library control, I get an error:
Here is the code I'm using to filter the list and library control:
//Code will filter the List/Library Control based on Hospital
FinanceCOHDataTable.ready(function() {
filterFinanceCOHDTbyHospital();
});
//filter List or Library with new value when Search field changes
fd.field('FinanceCOHHospitalField').$on('change', function() {
filterFinanceCOHDTbyHospital();
});
function filterFinanceCOHDTbyHospital(){
if(fd.field('FinanceCOHHospitalField').value){
//Filters HOSPITAL Column
FinanceCOHDataTable.filter = "<Contains><FieldRef Name='Hospital'/><Value Type='Text'>"
+ fd.field('FinanceCOHHospitalField').value + "</Value></Contains>";
}
else{
FinanceCOHDataTable.filter = '';
}
FinanceCOHDataTable.refresh();
}
How do I escape the ampersand character in this code?
Thank you!