This is a discussion on "dropdown menu / list box" within the JavaScript Forum section. This forum, and the thread "dropdown menu / list box are both part of the Program Your Website category.
|
|
|
|
|
![]() |
||
dropdown menu / list box
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
|||
|
dropdown menu / list box
Just like the dropdown menu / listbox that pops open when I "Open File" with FireFox . . . as I type the file name in the user-input box, a drop-down box offers me a list of files that correspond to the letters I'm typing . . . what is that called? Can someone give me information? What is the technical term for that sort of "widget / gizmo"? Any suggestions about where I might find code that would allow me to put that in my web page?
thanks in advance for even the smallest bit of advice r. mullin |
|
|
|
|||
|
Re: dropdown menu / list box
Hi there Amalafrida, I have done something similar to this with a search box for an eCommerce site.
Basicly you started to type in some characters and an AJAX script then called a php file to check the database for products which those characters in them. To what degree do you need to use it? |
|
|||
|
Re: dropdown menu / list box
you asked: to what extent do I need to use it?
I have a collection of about 400 small ".html" files. I want to provide the user an input box and as they type, a window will open that begins listing the possible files based on the user's input . . . so, let's say 20 files in the total list of files user types "abc" at first character, all first-letter "a" files are visible in the list box, then "auto-scrolls" down to the "ab" files and finally the "abc" file becomes visible. user then clicks that entry and the "abc.html" file opens. pretty simple and straightforward in the coding, I feel sure. But I want a list with a scroll bar, so that if the file requested is not available, user can scroll and find similar items. many "date of birth" input boxes work this way . . . as one types numbers the highlighter moves to the corresponding number . . . "1" highlights the number "1" in the list, then type "2", "12" becomes highlighted, then type "3", "123" becomes highlighted. In reality it is for a document index. All the index terms will be accessible through a link in the dropdown list. I'm working through a good javascript tutorial now and beginning to pick up the simple tools necessary, but if you could point me to some code snippets or sites that use a simple device of this sort, I'd appreciate it. It may be that I'm going to need to link to a database. But not quite sure about that. What if my index has 700 terms? In any case, I thank you for your time and information. Very kind of you to reply. West Midlands? that in England? I'm sitting down here in France, without too many "English language" programming books available. Gotta get it all from the internet . . . Cordially, R. Mullin |
|
|||
|
Re: dropdown menu / list box
Hey there, right well in all honesty I cant see a way of doing this myself. I mean instead of using a database you could hard code a javascript array to store all the information you needed but the problem is with the inputing into a text box and auto selecting the drop down. I'm thinking some sort of formula would have to be written to check each array against what was entered, so like when the person types in the letter a it would cycle through the array, retrieve all the parts that begin with a and then re-output the drop down to show only those.
So in short what I think you need to do in order to achieve this is to have a standard text input field, user starts typing. The files are stored in an array. Depending on the text entered will determine how many parts of the array are returned. You would then remove all entries from the drop down list and re-ouput the new ones.. I have only ever done dynamic drop downs once before and never needed a use for it again. If you get majorly stuck drop me a line and i'll see if I can dig up some information for you |
|
|||
|
Re: dropdown menu / list box
ok. thanks, i'll keep your address handy. my approach at the moment is to:
1) break the files up into 26 files . . . a-z 2) user begins typing index word "joinville" . . . for instance 3) javascript catches first letter . . . opens j.html file which contains all entries beginning with "j" 4) then comes the mystery part . . . how to get the dropdown list box to slide down the list of words as user continues typing . . . i'll figure it out and will let you know something. once again, thanks for the reply. r. mullin |
|
|||
|
Re: dropdown menu / list box
If you manage to figure out step 4 then let me know..... actually it is possible using the method i meantioned before I beleive, you just tell the drop down to focus on a different entry
|
![]() |
| Tags |
| dropdown, filefinder |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| CSS dropdown menu problems | unitedcraig | Web Page Design | 6 | Apr 3rd, 2008 22:31 |
| program a change event on dropdown list | abdul | PHP Forum | 1 | Jan 9th, 2008 15:07 |
| menu, dropdown | everland | Flash & Multimedia Forum | 2 | Aug 21st, 2007 14:58 |
| image dropdown menu | waterox | JavaScript Forum | 3 | Dec 11th, 2006 02:48 |
| Dropdown menu | Jorgerb | Flash & Multimedia Forum | 6 | May 17th, 2005 08:29 |