Autocomplete only value in array
hi all
how can i prevent users to type other things in inputfield then value in array. For example
- <html lang="en">
- <head>
- <meta charset="utf-8" />
- <title>jQuery UI Autocomplete - Default functionality</title>
- <link rel="stylesheet" href="http://code.jquery.com/ui/1.9.2/themes/base/jquery-ui.css" />
- <script src="http://code.jquery.com/jquery-1.8.3.js"></script>
- <script src="http://code.jquery.com/ui/1.9.2/jquery-ui.js"></script>
- <link rel="stylesheet" href="/resources/demos/style.css" />
- <script>
- $(function() {
- var availableTags = [
- "ActionScript",
- "AppleScript",
- "Asp",
- "BASIC",
- ];
- $( "#tags" ).autocomplete({
- source: availableTags
- });
- });
- </script>
- </head>
- <body>
-
- <div class="ui-widget">
- <label for="tags">Tags: </label>
- <input id="tags" />
- </div>
-
-
- </body>
- </html>
users should type only the value from availableTags, other things should be avoid.
thx