I am having the foll0wing issue with this....
This is my scenario:
- Using AJAX ComboBox
- Set AutoComplete to Append
- Set AutoPostBack to True
- Set DropDownStyle to DropDownList
What I am trying to do:
I have a combobox with a list of employees which upon typing the first few letters of the name and when I HIT ENTER not SELECT the name, I would like the employee info to update in my Formview. This works fine if I SELECT the name, however not when I hit Enter.
In doing some research I have come to learn that Tabbing out of the combobox will cause the SelectedIndexChanged procedure to fire, which is fine by me, HOWEVER, I cannot get the act of hitting the ENTER key to mimic the act of hitting the TAB key.
This is what i have tried and it does not work
VB Code
Page Load
Me.ComboBox_Guest.Attributes.Add("onkeydown", "return SetNextControlFocus(event,'" + TextBox1.ClientID + "')")
ASP
Script
function SetNextControlFocus(e, controlclientid) {
var evt = e ? e : window.event;
var ctrl = document.getElementById(controlclientid);
if (ctrl) {
if (evt.keyCode == 9) {
ctrl.focus();
return false;
}
else {
if (evt.keyCode == 13) {
ctrl.focus();
return false;
}
else {
return true;
}
}
}
else {
return true;
}
}
Your assistance is greatly appreciated