Hi, I am working in asp.net with C# web application, i have used one textbox and image button for search funtion, i have created one user control for this, but problem is after i have entered value in textbox when i have pressed the enter button, its not at all working, if i will use mouse i can able to search values, how to enable to enter key at keydown event of textbox, the following script i have used , function Buttonfocus() { if(event.which || event.keyCode) { if ((event.which == 13) || (event.keyCode == 13) || (event.which == 10) || (event.keyCode == 10)) { document.getElementById("go").click(); return false; } } else { return true; } } Please anybody to help me solve this problem in my application, advanced thanks for any reply. Thanks.
As far as I know, there is no standard method named click. I think Opera supports this method, but no other browsers support this. If all you want to do is submit the form, then you can use the following line document.forms['[b]form_name_here[/b]'].submit() Code (markup): instead of document.getElementById("go").click(); Code (markup): Are you sure that the following is not the code that you actually want? <input type='text' name='query' /><input type='image' src='go_button.gif' name='go' /> Code (markup):