Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head><title>
Untitled Page
</title></head>
<body>
<form name="form1" method="post" action="example.aspx" id="form1">
<div>
<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwULLTE1MjM0NTI1NjgPZBYCAgMPZBYCAgEPEA9kFgIeCm9ua2V5cHJlc3MFMX" />
</div>
<script language="javascript" type="text/javascript">
function KeySortDropDownList_onkeypress (dropdownlist,caseSensitive) {
// check the keypressBuffer attribute is defined on the dropdownlist
var undefined;
if (dropdownlist.keypressBuffer == undefined) {
dropdownlist.keypressBuffer = '';
}
// get the key that was pressed
var key = String.fromCharCode(window.event.keyCode);
dropdownlist.keypressBuffer += key;
if (!caseSensitive) {
// convert buffer to lowercase
dropdownlist.keypressBuffer = dropdownlist.keypressBuffer.toLowerCase();
}
// find if it is the start of any of the options
var optionsLength = dropdownlist.options.length;
for (var n=0; n < optionsLength; n++) {
var optionText = dropdownlist.options[n].text;
if (!caseSensitive) {
optionText = optionText.toLowerCase();
}
if (optionText.indexOf(dropdownlist.keypressBuffer,0) == 0) {
dropdownlist.selectedIndex = n;
return false; // cancel the default behavior since
// we have selected our own value
}
}
// reset initial key to be inline with default behavior
dropdownlist.keypressBuffer = key;
return true; // give default behavior
}
</script>
<div>
Find 'Brown" by typing 'b', 'r', 'o' when the dropdownlist has focus<br />
<br />
<select name="KeySortDropDownList1" id="KeySortDropDownList1" onkeypress="return KeySortDropDownList_onkeypress(this,false)" style="Z-INDEX: 101; LEFT: 448px; POSITION: absolute; TOP: 176px">
<option selected="selected" value="Apple">Apple</option>
<option value="Bozo">Bozo</option>
<option value="Braun">Braun</option>
<option value="Bream">Bream</option>
<option value="Brown">Brown</option>
<option value="Capitol">Capitol</option>
</select>
</div>
</form>
</body>
</html>
but i am not able to edit in dropdown