How to process the suggestions done by datalist on user input?

35 Views Asked by At

I have an input textbox for, say, firstname/lastname using datalist, the list being built from a data base. If the final input from the user is in the list, I can trigger a request in the database with the input, but if the final input is not, the form for must ask for other data (email, ...) by showing new input boxes. The problem is to detect (I use javascript) when there are no more suggestions by datalist (meaning the user is willing to give a name that is NOT in the list), and then the form will open the new input boxes. I can't do this by just analysing if the characters typed by the user are or are not in the list (the analysis is triggered by input event), but rather by searching the suggestion list.

0

There are 0 best solutions below