<select> tag reposting
https://stackoverflow.com/questions/1226528
Question
After several failed attempts using ExtJS I have now decided to use javascript.The requirement is to assist a combo box in select tag.If the list contains aa,aaa,aab,abc,bac,cba then if I type 'ab' continuously then it will select 'abc'.Whereas if I type 'a' time gap and then 'b' it will select 'bac' instead of 'abc'. Can anyone tell me whether its possible in js to get what I want?If not js is it possible in Jquery.Please ignore the previous duplicates.
Solution
It's possible. You're going to want to track when you your keypress events fire. Capture the time the "a" was entered, and then the time the second key was entered. If it's above a threshold, you want the second letter to be first, and the first letter to come second. If it's below your threshold, you want the first letter first, and the second letter second.