i found that code a long time ago and add it an hebrew support
it is in javascript so it can be used in .net too
add the script in the head
<script language="JavaS cript" src="includes/combo.js"></script>
////////////////// IE4+ ComboBox Script -- (C) 1999 by Ralph L. Brown
(akakEk) ////////////////////
var UNDEFINED; // do not assign!
function getX(obj)
{
return( obj.offsetParen t==null ? obj.offsetLeft :
obj.offsetLeft+ getX(obj.offset Parent) );
}
function getY(obj)
{
return( obj.offsetParen t==null ? obj.offsetTop :
obj.offsetTop+g etY(obj.offsetP arent) );
}
function isvalidchar(ach ar,validstr)
{
return(
validstr.toUppe rCase().indexOf (achar.toString ().toUpperCase( ),0) >= 0
);
}
function onSelectFocus( objSelect, flgInput )
{
if ( document.layers ) // NS4 (which doesn't work for SELECT objects
anyway)
{
//document.captur eEvents( Event.KEYPRESS | Event.KEYDOWN |
Event.KEYUP );
//document.onkeyd own = selectKeyDownHa ndler;
//document.onkeyp ress = selectKeyPressH andler;
//document.onkeyu p = null;
}
else if ( document.all ) // IE4
{
if ( !document.all.d ivComboBubble ) // if this is the first time
this function is called
{ // then create the bubble text
window (<DIV>).
document.body.i nsertAdjacentHT ML("beforeEnd" ,
"<DIV id='divComboBub ble'
style='position :absolute;top:0 px;left:0px;vis ibility:hidden' ></div>");
}
// create/init data elements
objSelect.X = getX(objSelect) +2;
objSelect.Y = getY(objSelect)-20;
objSelect.strKe yInBuf = '';
objSelect.flgIn put = false;
// if flgInput is 'INPUT' then this is an enterable list box.
if ( flgInput != UNDEFINED )
{
objSelect.flgIn put = ( (''+flgInput).t oUpperCase() == 'INPUT' );
}
// setup event handlers
objSelect.onmou seover = selectMouseOver Handler;
objSelect.onmou seout = selectMouseOutH andler;
objSelect.onblu r = selectBlurHandl er;
objSelect.onkey down = selectKeyDownHa ndler;
objSelect.onkey press = selectKeyPressH andler;
objSelect.onkey up = null;
// display bubble help (title)
//objSelect.onmou seover(window.e vent); // this should work, but in
early versions of IE4 it doesn't!
selectMouseOver Handler(window. event);
}
}
function BubbleText(objS elect)
{
var s = divComboBubble. innerHTML = '';
if ( !objSelect ) // for the onBlur event to clear out the bubble
help
{
return(false);
}
with ( objSelect )
{
if ( strKeyInBuf.len gth > 0 )
{
if ( strKeyInBuf == title )
{
s = '<FONT color="blue">' + strKeyInBuf + '</font>';
}
else if ( ( selectedIndex >= 0 ) && ( strKeyInBuf ==
options[selectedIndex].text ) ) // unique match found
{
s = '<B>' + strKeyInBuf + '</b>';
}
else
{
var c =
strKeyInBuf.sub string(strKeyIn Buf.length-1,strKeyInBuf.l ength);
c = ( c == ' ' ) ? ' ' : '<B>' + c + '</b>';
s = strKeyInBuf.sub string(0,strKey InBuf.length-1) + c;
}
divComboBubble. innerHTML = '<TABLE cellpadding=0 cellspacing=0
style="backgrou nd-color:INFOBACKG ROUND;'
+ 'font:8pt ms sans serif;padding:2 px 2px 2px
2px;color:INFOT EXT;border:1px solid INFOTEXT">'
+ '<TR><TD align=left><NOB R>'+s+'</nobr></td></tr></table>';
}
divComboBubble. style.posLeft = X;
divComboBubble. style.posTop = Y;
divComboBubble. style.visibilit y = '';
}
return(true);
}
function findSelectEntry ( objSelect, head, tail ) // uses
divide-and-conquer search, assumes sorted list
{
with ( objSelect )
{
if ( options.length <= 0 )
{
strKeyInBuf = ' <FONT color="red">No selections available.</font>
';
BubbleText( objSelect );
window.status = strKeyInBuf = '';
return(-1);
}
if ( strKeyInBuf == '' )
{
strKeyInBuf = title;
BubbleText( objSelect );
window.status = strKeyInBuf = '';
selectedIndex=0 ; // set to top
return( selectedIndex = options[selectedIndex].text.length ? -1 :
0 );
}
var mid = Math.round( (head+tail)/2 );
if ( strKeyInBuf.toU pperCase() ==
options[mid].text.substring (0,strKeyInBuf. length).toUpper Case() )
{
while ( (mid>0) && strKeyInBuf.toU pperCase() ==
options[mid-1].text.substring (0,strKeyInBuf. length).toUpper Case() )
{
mid--; // get the topmost matching item in the list, not just
the first found
}
selectedIndex=m id;
window.status = strKeyInBuf =
options[mid].text.substring (0,strKeyInBuf. length);
if ( mid == Math.round( (head+tail)/2 ) ) // if the original mid
is an exact match
{
if ( (mid==tail) || ( (mid<tail) && strKeyInBuf.toU pperCase()
!= options[mid+1].text.substring (0,strKeyInBuf. length).toUpper Case() )
)
{
window.status = strKeyInBuf = options[mid].text; // unique
match found
}
}
BubbleText( objSelect );
return( selectedIndex );
}
if ( head >= tail ) // then since no exact match was found, go back
to previous strKeyInBuf (thus the length-1)
{
strKeyInBuf = strKeyInBuf.sub string(0,strKey InBuf.length-1)
return( findSelectEntry ( objSelect, 0, options.length-1 ) );
}
if ( strKeyInBuf.toU pperCase() <
options[mid].text.substring (0,strKeyInBuf. length).toUpper Case() )
{
return( findSelectEntry ( objSelect, head, Math.max(head,m id-1) )
);
}
return( findSelectEntry ( objSelect, Math.min(mid+1, tail), tail ) );
}
}
function selectMouseOver Handler(e)
{
var event = e ? e : window.event; // to handle both NS4 and IE4
events
if ( event.srcElemen t.strKeyInBuf == '' )
{
event.srcElemen t.strKeyInBuf = event.srcElemen t.title;
BubbleText( event.srcElemen t );
event.srcElemen t.strKeyInBuf = '';
}
else
{
BubbleText( event.srcElemen t );
}
return(true);
}
function selectMouseOutH andler(e)
{
var event = e ? e : window.event; // to handle both NS4 and IE4
events
if ( event.srcElemen t != document.active Element )
{
BubbleText( event.srcElemen t );
}
return(true);
}
function selectBlurHandl er(e)
{
var event = e ? e : window.event; // to handle both NS4 and IE4
events
event.srcElemen t.strKeyInBuf = '';
window.status = (event.srcEleme nt.selectedInde x>=0) ?
event.srcElemen t.options[event.srcElemen t.selectedIndex].text : '';
BubbleText( event.srcElemen t );
return(true);
}
function selectKeyDownHa ndler(e)
{
var event = e ? e : window.event; // to handle both NS4 and IE4
events
with ( event.srcElemen t )
{
// this is to correct the search bug when the list is left open
after single-click
if ( ( strKeyInBuf == '' ) && ( event.keyCode > 40 ) )
{
event.srcElemen t.blur();
event.srcElemen t.focus();
}
switch(event.ke yCode)
{
case(8): // backspace
{
if ( ( selectedIndex >= 0 ) && ( strKeyInBuf ==
options[selectedIndex].text ) && !event.srcEleme nt.flgInput )
{
window.status = strKeyInBuf = '';
}
else
{
window.status = strKeyInBuf =
strKeyInBuf.sub string(0,strKey InBuf.length-1);
}
BubbleText( event.srcElemen t );
event.keyCode = 0;
return(false);
}
case(9): // tab
case(13): // enter
{
event.keyCode = 9; // convert enter to tab
return(true);
}
case(27): // escape
{
window.status = strKeyInBuf = '';
BubbleText( event.srcElemen t );
event.keyCode = 0;
return(false);
}
case(32): // space
{
window.status = strKeyInBuf += ' ';
// this must be fired explicitely for spaces
return( event.srcElemen t.flgInput ? event.srcElemen t.flgInput :
selectKeyPressH andler(event) );
}
// I don't know if these are universal
case(33): // page up
case(34): // page down
case(35): // end
case(36): // home
case(38): // up arrow
case(40): // down arrow
{
window.status = strKeyInBuf = '';
BubbleText( event.srcElemen t );
return(true);
}
} // end switch
} // end with
return(true);
}
function selectKeyPressH andler(e)
{
var event = e ? e : window.event; // to handle both NS4 and IE4
events
if ( event.keyCode == 13 ) { event.srcElemen t.blur();
event.srcElemen t.focus(); }
if (
isvalidchar(Str ing.fromCharCod e(event.keyCode ),"אבגדהו זחטיכלמ *סעפצקרש תףךץןםABC DEFGHIJKLMNOPQR STUVWXYZ0123456 789
`~!@#$%^&*()_-+={}[]|:;'<>,./?\\\"" ) )
{
event.srcElemen t.strKeyInBuf +=
String.fromChar Code(event.keyC ode);
}
if ( event.srcElemen t.flgInput ) // this is an enterable field
{
event.srcElemen t.options.lengt h = 0;
event.srcElemen t.strKeyInBuf =
event.srcElemen t.strKeyInBuf.s ubstring(0,31); // maxlength=32, should
be set elsewhere
event.srcElemen t.options[0] = new Option(
event.srcElemen t.strKeyInBuf, event.srcElemen t.strKeyInBuf );
event.srcElemen t.selectedIndex = 0;
}
else // search to find the matching value
{
// must use setTimeout to override the default SELECT keypress
event(s)
var strSel = 'document.' + event.srcElemen t.form.name + '.' +
event.srcElemen t.name;
setTimeout( 'findSelectEntr y(' + strSel + ',0,' + strSel +
'.options.lengt h-1);' , 1 );
}
return(true);
}
////////////////////////////////// -- End ComboBox.js --
////////////////////////////////////////
and the select option tag should look like this
<select name='article_m agazine_id' onFocus='onSele ctFocus(this)'
title='magazine ' >
<option ............... ............
....
....
</select>
ex********@yaho o.com wrote:
Hi,
I couldnt locate a Classic ASP group hence posting here.
One of my colleagues has designed an intranet site and one of the pages
has a drop-down box with close to 300 options. I want to navigate to
the desired option quickly just by typing out the name. For example if
I want to choose "Other" (All the options are arranged alhabetically
within the Drop-down box) from Drop-down and if I Type "O" then I
navigate to first entry with letter "O" but if I follow it up quickly
with "T" then jump to entry with first letter as "T".
What technique to use so that one can type O, then T, then H and be
able to quickly navigate to Entry with first three letters as "OTH"
Please guide me.
Regards,
Hari
India