Hello. I try to make an input field by typing in which the first letters pop up a list with prompts from an existing array of words. And if the entered word is in the array, the submit button becomes active and you can submit the form. This has already been implemented (by common efforts) - https://jsfiddle.net/f67v76mb/
$("#tags").keyup(function() { var availableTags = [ "ActionScript", "AppleScript", "Asp", "BASIC" ]; if(availableTags.indexOf($(this).val()) == -1 ) { $('input[type="submit"]').prop('disabled', true); } else { $('input[type="submit"]').prop('disabled', false); } $("#tags").autocomplete({ source: availableTags }); }); But in this solution, if you select a word from the pop-up list, the button does not become active, you must enter the entire word + it is case sensitive.
I would be very grateful for any useful information. I rarely work with ajax, js ...