Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

bootstrap datalist issue in Google Chrome

I am using twitter bootstrap datalist to display items.
In FF, the items are automatically showing once start typing. but it is not showing in Google Chrome. what could be the issue with Chrome?

<datalist id="d1">
  <option>13:59</option>
  <option>3:55</option>
  <option>6:55</option>
</datalist>

enter image description here

like image 619
vishnu Avatar asked Apr 17 '15 09:04

vishnu


1 Answers

a datalist is used to give the user some options to choose from. For example by an input field you can add a datalist with some default options to give the user some suggestions.

if you just want an option select use <select> but if you want it to work like you asked (in chrome 20+), see my fiddle or example code below.

be sure to choose a matching ID in this case 'd1'

<input list="d1">
<datalist id="d1">
  <option>13:59</option>
  <option>3:55</option>
  <option>6:55</option>
</datalist>

Click to see it work on fiddle here

w3schools says that it is not supported in Safari

like image 52
Paul Avatar answered Oct 10 '22 21:10

Paul