Javascript Autocomplete Dropdown - Javascript Tutorial For Beginners

Sdílet
Vložit
  • čas přidán 6. 09. 2024
  • In a high performing user friendly website, we use the autocomplete feature to give the user the ability to search on a list fast, we often tend to use some libraries but in this video we will see how easy it is to build your own autocomplete input box from scratch using HTML, CSS and Javascript, so stay tuned right till the end.
    Autocomplete can be a useful feature in websites where the users have a form to fill and there is a dropdown with a huge list to select from.
    Scrolling on the list and finding the correct selection can be a painful task, so for user's ease, we should add an autocomplete form or an autocomplete dropdown where the user can autocomplete on the input text box and the filtered results are shown in the dropdown below.
    That makes a good user experience too.
    We will fetch data using the Fetch API in javascript and will map the results into a variable and we will use this data to populate the list.
    Then will will introduce the Autocomplete search functionality such that when user types into the input text box, the user is shown a filtered data of result or an autocompleted data.
    💖 Subscribe to show support: bit.ly/2FAgXzS
    ☕ Buy me a coffee: www.buymeacoff...
    #Autocomplete #Javascript #HTML

Komentáře • 25

  • @w3g619
    @w3g619 Před rokem

    This what I've been searching for weeks! Thank you so much!

  • @manaraga9463
    @manaraga9463 Před rokem

    I tried so many times to make this menu but only this video helped

  • @cocoyana
    @cocoyana Před 2 lety +1

    Appreciate your concise and logical explanation!

  • @shubhamdhiman7516
    @shubhamdhiman7516 Před rokem

    Thankyou for this tutorial. It's really helpful in my project.

  • @ramnarasimhan1499
    @ramnarasimhan1499 Před 2 lety +1

    The video is really well, Sameer. Keep up the good work, and thank you for sharing your knowledge.

  • @NicoHeinrich
    @NicoHeinrich Před 2 lety +1

    Box-sizing: Border-box;
    Makes life easier! ;)

    • @SameerSaini
      @SameerSaini  Před 2 lety +1

      Yea, I have started using that from now onwards :)
      No need to do all those nasty calculations.

  • @mohammedabdulaziz3658
    @mohammedabdulaziz3658 Před 2 lety +3

    Too clean code sir, awesome 👍 thank you so much

    • @SameerSaini
      @SameerSaini  Před 2 lety

      Glad you liked it

    • @mohammedabdulaziz3658
      @mohammedabdulaziz3658 Před 2 lety +1

      Sir, please a series of javascript & es6 with real-time examples.. I really like it they way you write a code..#inspiration

  • @jaimeandrescarcamosepulved2456

    It was very helpful. Thank you for your content!

  • @eberebenny3311
    @eberebenny3311 Před 2 lety +2

    this is a great video, but the countries displaying cannot be selected, can you please fix this? Thanks

    • @eberebenny3311
      @eberebenny3311 Před 2 lety

      hey sir please can you also write or reply my comment if no video coming soon? lol i'd really love to know how this is done

  • @salmanrazakmemon
    @salmanrazakmemon Před 2 lety

    hay Sameer it worked like a charm... my array have multiple value such as image, title, quantity, price, etc... how is it possible searching through specific title.
    function filterData(data, searchText) {return data.title.filter((x) => x.toLowerCase().includes(searchText.toLowerCase()));}
    here it gives me an error of lower case.

  • @markbarrie5373
    @markbarrie5373 Před 7 měsíci

    Thank you for this

  • @davitkvaratskhelia4033
    @davitkvaratskhelia4033 Před rokem +3

    Source code ?

  • @christinakarlhoff1058
    @christinakarlhoff1058 Před 2 lety

    Hello! How would i alter the code to search for a number? I have a json array of specific numbers and i want to use autocomplete to match the number input by the user. I would appreciate your assistance. Thanks!

  • @matteorodriguez4068
    @matteorodriguez4068 Před 2 lety +1

    Hello man, Thanks for your videos.... i have a question; how i can to use fetch with a data from a table of SQL Server?

    • @SameerSaini
      @SameerSaini  Před 2 lety

      You will have to use a backend language to write an API to fetch data from.
      Some thing like php, java, aspnet etc

  • @Fullstackdev18
    @Fullstackdev18 Před 2 lety

    Awesome man! Thanks :)

  • @dahiya24368
    @dahiya24368 Před 2 lety +1

    where to get java file

  • @mirror-images
    @mirror-images Před 2 lety

    Hello! Thank you for the upload, this video is very helpful. I am having some issues with the autocomplete portion. Upon user input, the dropdown menu does not seem to show all the possible results. For example, when I type in "new," I see "New Zealand" and "Papua New Guinea" but not "New Caledonia" in the dropdown. I am not sure how to troubleshoot this error.

    • @kirankothandan5529
      @kirankothandan5529 Před 11 měsíci

      If you are not able to see then the API itself didn't return new caledonia😢

  • @Shubham123
    @Shubham123 Před rokem

    19:49