How to set auto-complete suggestions with 'datalist' - HTML Tutorial

preview_player
Показать описание
In this video I'll be showing you how to use the HTML "datalist" element to setup auto-suggestions for your input fields. This allows you (or the web page) to be in control of suggestions rather than the default auto-complete.

Support me on Patreon:

For your reference, check this out:

Follow me on Twitter @dcodeyt!

If this video helped you out and you'd like to see more, make sure to leave a like and subscribe to dcode!
Рекомендации по теме
Комментарии
Автор

Thanks a lot, I was searching the video on this topic from a long ago

prathmeshsikchi
Автор

Didn't know this was available with html only. Thanks man.

zurggie
Автор

Great video! Is there a way to lock users into using ONLY the defined list items, rather than letting them type ANYTHING in the input field?

hstrinzel
Автор

Thanks a lot. Just learned something new

tamalanwar
Автор

Thanks, Sir what is the solution if to say I speed out data from DB with id e.g 1 red, 2 blue, 3 green ... where I want to suggest the user color names, when user selected a color I want display only the name while storing the color id in the input. I need your help Sir.

Thanks in advance

umtabtv
Автор

i have a 4 lake records and datalist size is going to out of modal page any solution here, i just want to show 10 records on first mouse hover or click,

yogeshvaidya
Автор

Nice. Anyway of having a default suggestion? IE if 'pink' didn't exist as an option, having 'no color found'?

nickwoodward
Автор

hi, how to change width of datalist? in my situation it depends on width of the elements, but i want fix the width and it should be equal withd of the label

ziwbqdf
Автор

anyone with a clever solution to allow for a different order of words?
for instance if an option is "java script" and i search "script java" in the input field the option isn't shown.

nicolajslvsten
Автор

How to make suggestion from the database like Udemy it even give word before you write

jorgeabuauad
Автор

Please include the javascript error handling while using datalist

Its-N
Автор

At 3:27, how did you write on all three lines at the same time? Thanks

simplejosecom
Автор

I want to know how you added custom css to it. For me any custom css is not working.

mongalmoykarmakar
Автор

How would you connect this to a database? Like a Read from database and give suggestions from there

guidedog
Автор

Could you please make a video on how to add CSS to the datalist tag and its options??

bssushmitha
Автор

I'm calling you out on #31days 31coding projects challenge ..

kalenzo
Автор

had literally nothing to do with auto-complete.. waste of time. Glad I skipped most of it.

modeal
Автор

Thanks, Sir what is the solution if to say I speed out data from DB with id e.g 1 red, 2 blue, 3 green ... where I want to suggest the user color names, when user selected a color I want display only the name while storing the color id in the input. I need your help Sir.

Thanks in advance

umtabtv