Results 1 to 4 of 4

Thread: HELP!! dynamically populate listbox/drop-down

  1. #1

    Thread Starter
    Junior Member
    Join Date
    May 2000
    Posts
    17

    Question HELP!! dynamically populate listbox/drop-down

    Here's one for ya:

    I have a textbox and a drop-down menu used for a browser-based 'search' application.

    I want the user to be able to type in text in the textbox, and have the drop-down menu repopulated on each keypress (by data pulled from a database)

    example: there are 10 B words in the database. if the user types B, all the words will pop up in the drop-down. If the user types Br, only the words starting with (or containing) BR will be in the drop-down... get it?

    i'm using coldfusion to do the database query (select * from TABLE where WORD LIKE [form.textbox]

    ANY IDEAS???

  2. #2
    Frenzied Member Mark Sreeves's Avatar
    Join Date
    Nov 1999
    Location
    UK
    Posts
    1,845
    Sounds painfully slow to me!

    Each time the user types a letter in the dropdown box the page will have to be refreshed from the server. Yuk!
    Mark
    -------------------

  3. #3
    New Member
    Join Date
    Jun 2002
    Posts
    2

    Cool

    Its an intranet site. bandwidth isn't an issue. any ideas?

  4. #4
    New Member
    Join Date
    Jun 2002
    Posts
    2
    i wouldnt want the page refreshed, just the items in the listbox... the more i explain it, the more silly and impossible it seems...

    as an alternative, i just had the sql query populate the dropdown with all possible values from the database:

    (if you're familiar with coldfusion):

    [CODE]<cfquery name="GetItemsForDropDown" datasource="projdec">
    select * from MyDatabase
    </cfquery>

    <select name="MyDropDown">
    <cfoutput query="GetItemsForDropDown">
    <option value="#OneItem#">#OneItem#</option>
    </cfoutput>
    </select>
    it works, its just not as nice as i'd like it to be

Posting Permissions

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



Click Here to Expand Forum to Full Width