SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Threaded View

  1. #1
    SitePoint Wizard
    Join Date
    Dec 2004
    0 Post(s)
    0 Thread(s)

    scriptaculous autocomplete ALMOST working - help?

    EDIT Nov 1: worked around the issue with javascirpt array.

    The code below does bring up a list of names when typing begins. BUT, it brings the entire list every time no matter what you type. For example, I type an "m" in the field and the list starts with "A". Th elist has over a hundred so it should narrow the search as you type more, it does not.

    I got the scriptaculous autocomplete.LOCAL to work fine. I can not use that version because I need to add an additional value the field (see documentation) and update a field afterUpdate.

    The results.php is a database call that creates a file with proper scritaculous formatting like:

    Here's the code:

    HTML Code:
    <input id="companies" name="companies" autocomplete="off" size="40" type="text" value="" />
    <div class="page_name_auto_complete" id="company_list" style="display:none;border:1px solid black;background-color:white;"></div>
    <input type="hidden" name="company_id" id="company_id" value=""/>
    <script type="text/javascript">
    new Ajax.Autocompleter('companies', 'company_list','results.php', {});
    // ]]>
    Any ideas how to get this to narrow down the selection as you type instead of showing ALL choices when ANYTHING is typed?
    Last edited by WebDevGuy; Nov 1, 2006 at 04:51.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts