Prevent users from updating a value in a text box after selecting it from the autocomplete list

I have a textbox that is an autocomplete field that allows the user to enter values ​​into it, but the user can change the value after being selected from a list of filled values. To avoid this, I tried using combobox, but combobox doesn't seem to work with input and only works with select. In my case, I cannot use select as the values ​​that come from the database table and not any predefined values.

Is there a way to prevent users from selecting any values ​​other than those in the autopopulation list in the textbox? I believe that we can do it with jQuery, since I don't have enough knowledge of jQuery, I can't check any solution for it.

Can anyone help me with this?

+3
javascript jquery html php


source to share


No one has answered this question yet

Check out similar questions:

2132
Get selected text from dropdown (select field) using jQuery
1566
Get selected value in dropdown using JavaScript
957
Get the value in the input text box
724
Change selected dropdown value with jQuery
711
Prevent users from submitting the form by pressing Enter.
87
Clear field field after selection for jQuery UI autocomplete
39
jQuery UI Autocomplete: only allow selected from the suggested list
13
Force user to select from jQuery UI autocomplete and populate hidden field after selection
8
JQuery UI autocomplete: force selection from list without change
0
search box or autocomplete text box for UL listing search



All Articles
Loading...
X
Show
Funny
Dev
Pics