GIDForums  

Go Back   GIDForums > Webmaster Forums > Web Design Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 03-Nov-2004, 15:18
nmahdjour nmahdjour is offline
New Member
 
Join Date: Sep 2004
Posts: 7
nmahdjour is on a distinguished road

dropdown list scrolling


Hi,

Is there a way to create a dropdownlist that enables me to browse through its items by typing in more than one letter? For instance, if there are two words "mysql" and "mssql", I'd like the selector to jump to "mysql" in case I type in "my".

Thanks,
Nima
  #2  
Old 05-Nov-2004, 15:41
Corey Bryant Corey Bryant is offline
Member
 
Join Date: Oct 2003
Location: Castle Rock, CO
Posts: 216
Corey Bryant will become famous soon enough
As far as I know, no. I tried it a few different ways & could only get the to go to the M or the Y but not my
  #3  
Old 06-Nov-2004, 13:08
crystalattice's Avatar
crystalattice crystalattice is offline
Aspiring author
 
Join Date: Apr 2004
Location: Japan (again)
Posts: 1,628
crystalattice is just really nicecrystalattice is just really nicecrystalattice is just really nicecrystalattice is just really nicecrystalattice is just really nice
I'm not aware of anything "pre-built". It sounds more like a job for a Java applet or other "real" program (Python, PHP, etc.).
__________________
Start Programming with Python-A beginner's guide to programming and the Python language.
-------------
Common Sense v2.0-Striving to make the world a little bit smarter.
  #4  
Old 06-Nov-2004, 20:51
BobbyDouglas's Avatar
BobbyDouglas BobbyDouglas is offline
Regular Member
 
Join Date: Aug 2003
Posts: 789
BobbyDouglas has a spectacular aura aboutBobbyDouglas has a spectacular aura about
There is a way to do this. I will try to figure this out. If I forget to reply within a few days, send me an e-mail: http://www.gidforums.com/sendmessage...ilmember&u=413
  #5  
Old 06-Nov-2004, 22:11
BobbyDouglas's Avatar
BobbyDouglas BobbyDouglas is offline
Regular Member
 
Join Date: Aug 2003
Posts: 789
BobbyDouglas has a spectacular aura aboutBobbyDouglas has a spectacular aura about

Drop down lists that allow selection


I finally found this: Drop down lists that allow selection

Looks like it will only work in ASP. Hopefully Spooky will reply with a method of accomplishing this in plain Javascript, without requiring ASP...
__________________
Mr. Bob's Web Design - Tirelessly looking for ways to enhance the customer base of your business.
  #6  
Old 07-Nov-2004, 13:01
BobbyDouglas's Avatar
BobbyDouglas BobbyDouglas is offline
Regular Member
 
Join Date: Aug 2003
Posts: 789
BobbyDouglas has a spectacular aura aboutBobbyDouglas has a spectacular aura about
Looks like it doesn't require ASP. Give it a check, and let me know if that is what you wanted to do.
__________________
Mr. Bob's Web Design - Tirelessly looking for ways to enhance the customer base of your business.
  #7  
Old 08-Nov-2004, 17:29
nmahdjour nmahdjour is offline
New Member
 
Join Date: Sep 2004
Posts: 7
nmahdjour is on a distinguished road

found it


thanks a lot,

i found a javascript for it, see below. in addition i had to add the attribute onButtonPress="evalKey" in the dropdownlist tag. sorry for posting so lately.

Code:
var tString = ''; var lsf = 0; // last successful index function evalKey() { // Global Variables var i = 0; var success = false; var elem = event.srcElement; var tLowElemText = ''; // Get the unicode char of the keypress var eCode = event.keyCode; // Check if it's a vaid ASCII Character if (eCode == 27){ tString = ''; elem.selectedIndex = 0; } else if ( (eCode > 31) && (eCode < 122)) { // Convert the Code to the corresponding character and add to searchstring tString += String.fromCharCode(eCode); // ... and perform the search starting from the top element in the listbox while (success == false) { i = 0; // Convert everything to lowercase; allows an easy comparison var tLowString = tString.toLowerCase(); // Compose the regexp searchstring ... var rExpr = eval("/^" + tLowString + "/"); while ((i < elem.length)&& (success == false) ) { tLowElemText = elem.options[i].text.toLowerCase(); // success: Position the listbox on the (first) found element if (tLowElemText.search(rExpr) != -1) { elem.selectedIndex = i; success = true; } else { i++; } } // while i < elem.length // if nothing is found in the entire list, the last character of the //searchstring is removed to allow typing the correct 'next' character if (success == false) { tString = tString.substr(0, tString.length-1); } } // while success = false } window.event.returnValue = false; window.event.cancelBubble = true; }
 
 

Recent GIDBlogProgramming ebook direct download available by crystalattice

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Insert problem in Linked list Kay Chan C Programming Language 1 03-Sep-2004 18:06
link list help ohMan C Programming Language 1 04-Aug-2004 05:43
[CONTEST?]Data Structure Test dsmith C Programming Language 2 06-Jun-2004 16:13
help on linked lists any1????? nick4 C Programming Language 1 17-May-2004 10:32
[include] list1.h -- Linked list class dsmith C Programming Language 2 04-May-2004 10:42

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 00:35.


vBulletin, Copyright © 2000 - 2009, Jelsoft Enterprises Ltd.