Home Top Projects Tutorials Articles Submit Project
 
  • .NET Frameworks
  • Java Frameworks
  • PHP Frameworks
  • Ruby Frameworks
  • Other Frameworks
  • Cool AJAX sites
  • Ajax Resources
  • Ajax Tools
  • JavaScript frameworks
 
     
    • Guide to Using XMLHttpRequest
    • Simple Contact Form with JQuery Validation
    • Calendar widget for Prototype
    • How to use UpdateProgress Control ASP.NET Ajax
    • Drag and Drop with AJAX Example
    • Architecture - Cross Domain AJAX Using A Proxy
    • A jQuery Twitter Ticker
    • Flexstore on Rails Tutorial
    • File Upload with AJAX.NET Progress Bar
    • Creating a Dynamic Poll with jQuery and PHP
    Home » Tutorials » AutoCompleter 101

    AutoCompleter 101

    PLAIN TEXT
    JAVASCRIPT:

       1.
          
       2.
          <script src="jquery-1.2.1.pack.js" type="text/javascript"></script><script type="text/javascript">
       3.
          
       4.
          function lookup(inputString) {
       5.
              if(inputString.length == 0) {
       6.
                  // Hide the suggestion box.
       7.
                  $(‘#suggestions’).hide();
       8.
              } else {
       9.
                  $.post("rpc.php", {queryString: ""+inputString+""}, function(data){
      10.
                      if(data.length>0) {
      11.
                          $(‘#suggestions’).show();
      12.
                          $(‘#autoSuggestionsList’).html(data);
      13.
                      }
      14.
                  });
      15.
              }
      16.
          } // lookup
      17.
          
      18.
          function fill(thisValue) {
      19.
             $(‘#inputString’).val(thisValue);
      20.
             $(‘#suggestions’).hide();
      21.
          }
      22.
          </script>
      23.

    source: ajaxian

    Copyrights Reserved AjaxProjects.com 2006-2013, Powered by Enozom - Mobile Development Company -Privacy Policy