I have Data from an Ajax Drop Down list that I can't adjust. However, I only want to display dropdown elements that have a certain string part in its name ("Delivery").
I can't adjust the Ajax list directly so how can I manipulate the visibility on certain elements?
So this is part of the code that is currently used on the dropdown:
a.dropCityChanged = function() {
a.dropCities && (a.loading.dropLocations = !0, e.getAjax({
country: a.form.dropCountry.id,
city: a.form.dropCity.id
}).then(function(b) {
a.loading.dropLocations = null, a.dropLocations = b, 1 === b.length && (a.form.dropLocation = b[0])
}))
}
But I only want to show the dropLocations that have a certain string in its name
I tried a few things like (name~= "Delivery") and var.includes("Delivery") but none worked so far.
Added a screenshot from the dropdown, maybe makes it more clear, I only want the entries with "Hotel Delivery displayed: dropdown-example
Help is much appreciated.
Thanks.