please dont rip this site

Incremental Select in JavaScript


<head>
<SCRIPT = JavaScript>
	var timerid     = null;
	var matchString = "";
	var mseconds    = 5000;	// Length of time before search string is reset

	function shiftHighlight(keyCode,targ)
		{
			keyVal      = String.fromCharCode(keyCode); // Convert ASCII Code to a string
			matchString = matchString + keyVal; // Add to previously typed characters
			elementCnt  = targ.length - 1;	// Calculate length of array -1
			for (i = elementCnt; i > 0; i--)
			{
				selectText = targ.options[i].text.toLowerCase(); // convert text in SELECT to lower case
				if (selectText.substr(0,matchString.length) == 	matchString.toLowerCase())
				{
					targ.options[i].selected = true; // Make the relevant OPTION selected
				}
			}
			clearTimeout(timerid); // Clear the timeout
			timerid = setTimeout('matchString = ""',mseconds); // Set a new timeout to reset the key press string
		
			return false; // to prevent IE from doing its own highlight switching
		}
</SCRIPT>
</head>
<body>

<select tabindex=1 name=whatever accesskey='s' label='Select something' size=1 onKeyPress = 'return shiftHighlight(event.keyCode, this);'>'
<option>Type a selection</option>

file: /techref/language/java/script/incsel.htm, 1KB, , updated: 2004/2/19 11:03, local time: 2008/12/1 12:55,
TOP NEW HELP FIND: 
38.103.63.59:LOG IN
©2008 PLEASE DON'T RIP! DO: LINK / DIGG! / MAKE!

 ©2008 These pages are served without commercial sponsorship. (No popup ads, etc...).Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE. Questions?
Please DO link to this page! Digg it!
<A HREF="http://piclist.org/techref/language/java/script/incsel.htm"> Incremental Select in JavaScript</A>

After you find an appropriate page, you are invited to your to this massmind site! (posts will be reviewed) Just type in the box and press the Post button. (HTML welcomed!): A tutorial is available Members can login to post directly, become page editors, and be credited for their posts.


Link? Put it here: 
if you want a response, please enter your email address: 
Did you find what you needed?

  PICList 2008 contributors:
o List host: MIT, Site host massmind.org, Top posters @20081201 Apptech, Jinx, Xiaofan Chen, olin piclist, Vitaliy, William \Chops\ Westfield, Tamas Rudnai, JonnyMac, Alan B. Pearce, Gerhard Fiedler,
* Page Editors: James Newton, David Cary, and YOU!
* Roman Black of Black Robotics donates from sales of Linistep stepper controller kits.
* Ashley Roll of Digital Nemesis donates from sales of RCL-1 RS232 to TTL converters.
* Monthly Subscribers: Shultz Electronics, Timothy Weber, on-going support is MOST appreciated!
* Contributors: Richard Seriani, Sr.
  'What can I do?' - SiCKO

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

  .