I'm new to javascript & trying to achieve a feature for Select Box to incorporate the feature of a textbox also. Like my select box has two events attached, onchange=smeFunction(var1.value) & onkeyup=findValue(this).
Expand|Select|Wrap|Line Numbers
- function findValue(sel) {
- var temp = true;
- var k = String.fromCharCode(event.keyCode);
- fnd += k;
- for (var i=0; i<sel.options.length; i++) {
- if (fnd.toUpperCase() == sel.options[i].text.substring(0, fnd.length).toUpperCase())
- {
- sel.options[i].selected = true;
- temp = false;
- break;
- }
- }
- if(temp) {
- fnd = "";
- fnd += k;
- }
- return true;
- }
Please help, i am in great need,
Thanks in advance.....