Reputation: 2134
So I'm using the Bootstrap typeahead plugin to display a list of classes. It works fine for most courses, but if you click the dropdown for Driver's Education, the text displays in the input field as "Driver's Education".
Is there some way to fix this?
Upvotes: 3
Views: 1601
Reputation: 85558
It is because you define your source array as a data attribute, and therefore is interpreted with HTML-entities. To the opposit, when the options is defined in a javascript handler special chars as '
will show up normal when the list dropdowns and afterwards in the input field when you have clicked :
HTML wthout data attributes :
<input type="text" data-provide="typeahead" id="stackoverflow">
jquery constructer instead :
$("#stackoverflow").typeahead({
"source" : ["Driver's Education", "Toys'r'us Education"] //and so on
//(,) rest of options, if any
});
Upvotes: 2