Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Disable suggestions for HTML input list

I want to disable the suggestions for previously entered texts on a <input type="text" list="stuff"> which provides a drop down list to choose from via a <datalist>.

This behaviour causes some entries to be shown twice and sometimes problems occur when selecting them.

I tried <input type="text" autocomplete="off"> - in Firefox it works just like I want it to but Chrome disables the suggestions from the <datalist> as well.

I would be happy for any solution at all even if it involves JavaScript, thanks.

like image 393
JohnZoidberg Avatar asked Nov 09 '22 12:11

JohnZoidberg


1 Answers

Add autocomplete="off" onto element; Add hidden with autocomplete="false" as a first children element of the form.

like image 199
Rakibul Avatar answered Nov 14 '22 21:11

Rakibul