you need to filter your result list (which was static in your last
post) of course...

something like:

function autocomplete($needle,$haystack) {
      $html = '<ul class="autocomplete" id="list">';
      foreach($haystack as $straw) {
          if($needle != '' && stristr($straw, $needle)) {
              $html .= '<li class="autocomplete">'.$straw.'</li>';
          }
      }
      $html .= '</ul>';
      echo $html;
}

or when pulling data from a database using something like WHERE field
LIKE '$searchterm'

hth: lars

On Thu, Jan 29, 2009 at 5:08 PM, eulerss <eulers...@hotmail.com> wrote:
>
> i was checking my example and i think that it doesn't work propertly,
> for instance, if i type "p" all options appears, like
>
> alve
> alvr
> ..
> per
> par
> por
> ...
> zer
> zae
>
> and must appear the options that start with "p", isn't it?
> here is my code
>
> <form name="tarifas" method="post">
>                <table cellspacing="0" cellpadding="0" border="0">
>                        <tr>
>                                <td width="70" class="texto4">cliente:</td>
>                                <td width="200">
>                                <input type="text" id="autocomplete" 
> name="autocomplete_parameter"/
>>
>                                <span id="indicator1" style="display: none">
>                                <img src="/images/spinner.gif" 
> alt="Working..." />
>                                </span>
>                                <div id="autocomplete_choices" 
> class="autocomplete"></div>
>
>
>                                </td>
>                        </tr>
>                </table>
>
>                <script type="text/javascript">
>                        new Ajax.Autocompleter("autocomplete", 
> "autocomplete_choices",
> "li.php", {
>                        paramName: "value",
>                        minChars: 2,
>                        indicator: 'indicator1'
>                        })
>
>                </script>
>        </form>
>
> eulerss
>
> On 29 ene, 09:27, eulerss <eulers...@hotmail.com> wrote:
>> thanks a lot for you replay "disccomp", now it works, i think that i
>> was correct, because i only change the libraries for that one that you
>> put in the replay,my doubt is that in the past i was usig this
>> libraries in order to implement dependent selects and it works
>> perfectly, now i need to check my libraries, thanks again
>>
>> eulerss
> >
>



-- 
Lars Schwarz
Heiligengeiststr. 26
26121 Oldenburg
T 0441 36110338
M 0151 1727 8127
W www.bitrocker.com

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to