Hello. There is input, when entering text into which, displays hints from an already existing array of words.
<!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>jQuery UI Autocomplete - Default functionality</title> <link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css"> <link rel="stylesheet" href="/resources/demos/style.css"> <script src="https://code.jquery.com/jquery-1.12.4.js"></script> <script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script> <script> $( function() { var availableTags = [ "ActionScript", "AppleScript", "Asp", "BASIC" ]; $( "#tags" ).autocomplete({ source: availableTags }); } ); </script> </head> <body> <div class="ui-widget"> <form action="a.php" method="post" /> <label for="tags">Tags: </label> <input id="tags" name="text"> <input type="submit"> </form> </div> </body> </html> Question: How to make that if the user entered a word in the field that is not in the array with words, it was impossible to submit the form, and the submit button was not visible, or was replaced with text?
I would be very grateful for the help.