Imput as a field for entering a variant and as a live search, how to implement it?

  • 0
    Hello everyone.

    I want to implement such an option, I need to display the list from the database, there is an imput field, I enter the option in it, if it does not find it, then this option should be written as it is and remain so that it will be transferred from the form to the database.
    When I enter into a field, it is necessary that the list of suitable words be displayed at the bottom of the list, where you can select the option if it fits, if not, then my option remains in the field.

    There are selects, but there he searches according to the list, and he does not leave what he entered.
    JavaScript Anonymous, Jun 6, 2019

  • 1 Answers
  • 0

    1. Make an input.

    2. Hang up a letter input handler on it

    3. In the handler, make a request to the server and load a list of matching options

    4. Insert the list of incoming variants into the prepared & lt; datalist & gt;


Your Answer
To place the code, please use CodePen or similar tool. Thanks you!