Hi Shimon,
According to your description, I am not sure about what concern you have.
However, it seems that you are encountering some issues while working with
the autocomplete functionality of a comboBox. If it is the case, I have
written a simple sample for your reference. Here is the entire sample code.
<HTML>
<HEAD>
<TITLE>New Document</TITLE>
<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: alert(event.keyCode); searchString=searchString.substr(0,
searchString.length-1); break;
case 13: //document.frmTOP.submit(); 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>
</HEAD>
<BODY>
<form name=frmTOP method=post>
<select id=test onkeypress="onKey();" onfocus="clearSearchString();"
onchange="//document.frmTOP.submit();">
<option value=1>Gary</option>
<option value=1>Miranda</option>
<option value=1>Love</option>
<option value=1>Lost</option>
</select>
</form>
</BODY>
</HTML>
In my sample, if the current focus was on commoBox and we type "l",
followed by "os", the last item "Lost" will be selected. If we type "l",
followed by "ov", the third item, "love" should be selected.
Please let me know if it is what you are looking for.
Best regards
Jacob Yang
Microsoft Online Partner Support
Get Secure! ¨C
www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.