I have a text box and a button and I want the user to be able to use the autocomplete to select a value for the text box using the enter key. The problem is that on the event of the enter key pressed I want to call the button's click event, but what ends up happening is that the button's click event is called before the autocomplete finishes selecting a value.
I want the user to be able to select a value from the autocomplete list using the enter key and then press enter again to call the button's click event.
This is the code Im using to call the button's click event when enter is pressed.
TextBox1.Attributes.Add("onkeydown", "if(event.which || event.keyCode){if ((event.which == 13) || (event.keyCode == 13)) {document.getElementById('" + btnSearch.UniqueID + "').click();return false;}} else {return true}; ")
So
I want the user to be able to select a value from the autocomplete list using the enter key and then press enter again to call the button's click event.
This is the code Im using to call the button's click event when enter is pressed.
TextBox1.Attributes.Add("onkeydown", "if(event.which || event.keyCode){if ((event.which == 13) || (event.keyCode == 13)) {document.getElementById('" + btnSearch.UniqueID + "').click();return false;}} else {return true}; ")
So