7

In a form, I have a text input with a datalist. In the datalist, I have accented terms that won't appear in my text input. For example : If I type "a", terms with "ä" or "à" won't appear in suggestion...

The best would be the whole to be accent insensitive

Does anyone encounter that problem already ?

Thank you

VeZoul
  • 500
  • 6
  • 19

1 Answers1

1

One dirty way you can do this is by doing something likes this:

var noAccent = str.normalize( "NFD" ).replace( /[\u0300-\u036f]/g, "" );
if (str !== str) {// Add a duplicate entry without the accent}