autocomplete-basic.html 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <!DOCTYPE html>
  2. <html>
  3. <!--
  4. Copyright 2010 The Closure Library Authors. All Rights Reserved.
  5. Use of this source code is governed by the Apache License, Version 2.0.
  6. See the COPYING file for details.
  7. -->
  8. <head>
  9. <title>goog.ui.ac</title>
  10. <script src="../base.js"></script>
  11. <script>
  12. goog.require('goog.ui.ac');
  13. </script>
  14. <link rel="stylesheet" href="css/demo.css">
  15. <link rel="stylesheet" href="../css/autocomplete.css">
  16. <style>
  17. small {
  18. color: #999;
  19. font-size: x-small;
  20. }
  21. </style>
  22. </head>
  23. <body>
  24. <h1>goog.ui.ac</h1>
  25. <p>
  26. Tom Cruise Film Finder:<br>
  27. <input id="txtInput1" style="width:500px" /> <button>Go</button>
  28. </p>
  29. <p>
  30. Multi-Tom Cruise Film Finder:<br>
  31. <textarea id="txtInput2" style="width:500px"></textarea>
  32. <button>Go</button><br>
  33. <small>Data from Google Sets! Not my personal DVD collection!!!</small>
  34. </p>
  35. <script type="text/javascript">
  36. var tcMovies = [
  37. "Mission Impossible", "Top Gun","Jerry McGuire","Rain Man",
  38. "Days of Thunder", "Risky Business","Interview With The Vampire",
  39. "Eyes Wide Shut","Far And Away", "Jerry Maguire","The Firm","Cocktail",
  40. "A Few Good Men","Legend","Taps", "The Outsiders","Losin' It",
  41. "Endless Love","The Color Of Money", "All The Right Moves",
  42. "Minority Report","Magnolia","Mission Impossible 2",
  43. "Mission Impossible 3","Vanilla Sky","Ghost Soldiers","Few Good Men A",
  44. "Color of Money The","Firm The","Mission Impossible II","Outsiders The",
  45. "Young Guns","Top Gun DVD","Days of Thunder DVD","Cocktail",
  46. "Mission Impossible DVD","Fallen Angels Vol 1","Don't Look at Me",
  47. "Young Guns uncredited"];
  48. var ac1 = goog.ui.ac.createSimpleAutoComplete(
  49. tcMovies, document.getElementById('txtInput1'), false);
  50. var ac2 = goog.ui.ac.createSimpleAutoComplete(
  51. tcMovies, document.getElementById('txtInput2'), true);
  52. </script>
  53. </body>
  54. </html>