<kbd id="afajh"><form id="afajh"></form></kbd>
<strong id="afajh"><dl id="afajh"></dl></strong>
    <del id="afajh"><form id="afajh"></form></del>
        1. <th id="afajh"><progress id="afajh"></progress></th>
          <b id="afajh"><abbr id="afajh"></abbr></b>
          <th id="afajh"><progress id="afajh"></progress></th>

          Yet Another Autocomplete

          聯(lián)合創(chuàng)作 · 2023-10-02 06:20

          I created this plugin because I was not happy with any of the other ones. This plugin will give you simple, clean autocomplete functionality on the selected text box.

          Here's the code:

          HTML File:

          <form id="myform">
             <input type="text" name="my_textbox" id="my_textbox" />
          </form>
          <script type="text/javascript">
          <!--
          $(function()  {
             var data = {
                fn : 'lookup'
             };
             var options = {
                min_length : 3,
                error_responses : [
                   "No results.",
                   "Too many results."
                ]
             };
             $("#suggest").suggest("search.php", data, options);
          });
          -->
          </script>

           

          Example server-side PHP script, search.php:

          <?php
          // Prevent caching
          header("Cache-Control: no-cache, must-revalidate");   // HTTP/1.1
          header("Expires: Jan 1, 2000");   // Date in the past
          $fn          = $_GET['fn'];
          $allowed_fns = array('lookup');
          if (!
          in_array($fn, $allowed_fns))  { exit; }
          print
          call_user_func($fn);

          function
          lookup()  {
            
          $q = valueIfSet($_GET['q']);
            
          $attrs = array("uid", "givenname", "sn");
            
          $filter = "level03=95C";
             try {
               
          $results = your_ldap_lookup_function($q, $attrs, $filter, true, , 1);
             } catch (
          Exception $e)  {
                return
          "Too many results.";
             }
             if (
          count($results) === )  {
                return
          "No results.";
             }
            
          $list = array();
             foreach (
          $results as $result)  {
               
          $sn  = $result['sn'];
               
          $gn  = $result['givenname'];
               
          $uid = $result['uid'];
               
          $name = "$sn, $gn ($uid)";
               
          array_push($list, $name);
             }
             return
          implode("\n", $list);
          }
          ?>
          瀏覽 22
          點(diǎn)贊
          評(píng)論
          收藏
          分享

          手機(jī)掃一掃分享

          編輯 分享
          舉報(bào)
          評(píng)論
          圖片
          表情
          推薦
          點(diǎn)贊
          評(píng)論
          收藏
          分享

          手機(jī)掃一掃分享

          編輯 分享
          舉報(bào)
          <kbd id="afajh"><form id="afajh"></form></kbd>
          <strong id="afajh"><dl id="afajh"></dl></strong>
            <del id="afajh"><form id="afajh"></form></del>
                1. <th id="afajh"><progress id="afajh"></progress></th>
                  <b id="afajh"><abbr id="afajh"></abbr></b>
                  <th id="afajh"><progress id="afajh"></progress></th>
                  韩国黄色三集片 | 国产在线A片 | 国产美女内射视频 | 欧美另类操逼视频 | 免费黄色性爱网站 |