Hi James,
Based on my research and experience, you can refer to the following
javascript code to do what you want. (I have not fully tested the code
because there is not an existed sample. Thank you for your understanding.)
Just add "onKey();" as the onkeypress event handler for your SELECT
element. You can change the value of 1000 in the setTimeout call to
whatever timeout you desire (in milliseconds). This is the timeout for how
long the user has to wait for the search to reset. (e.g. once "Gar" has
been pressed, wait 1 second then type "Mir" and it will work)
===============================================
<SCRIPT language="JavaScript">
var searchString='';
var searchTimer=-1;
function onKey()
{
var i;
var j;
var eltOpt;
var elt=event.srcElement;
if (searchTimer!=-1)
clearTimeout(searchTimer);
switch (event.keyCode)
{
case 8: searchString=searchString.substr(0, searchString.length-1); break;
default: searchString+=unescape("%"+event.keyCode.toString( 16));
}
j=elt.options.length;
for (i=0; i<j; i++)
{
eltOpt=elt.options(i);
if (eltOpt.text.toUpperCase().substr(0,
searchString.length)==searchString.toUpperCase())
{
eltOpt.selected=true;
break;
}
}
searchTimer=setTimeout('clearSearchString();', 1000);
event.returnValue=false;
}
function clearSearchString()
{
searchTimer=-1;
searchString='';
}
</SCRIPT>
<SELECT name="truecombo" onkeypress="onKey();"
onfocus="clearSearchString();">
================================================== =
Doest it answer your question? If I have misunderstood your concern, please
feel free to let me know.
Best regards,
Jacob Yang
Microsoft Online Partner Support
Get Secure! 每
www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.