Categories: MSDN / DotNet / Java / Scripts / Linux / PHP Ask - La ask - La Answer

Enter button in Text Box - executes with no results

Hi,

I have a form that has several controls in a panel including several text boxes. The form is used to perform searches and then display results on the same page. In order to catch the Enter key being pressed, I've added a javascript onKeyDown() event to the panel. This event then executes a function that clicks the submit button. All controls, including the text boxes, fire the button click event fine, and the code executes as normal except in the case of the text boxes - nothing happens to the page in the end.

This problem only occurs in IE (everything works in FireFox)

Any ideas as to why this might be happening?

Thank you.

Ks.
[695 byte] By [kcyxa] at [2007-11-11 10:29:31]
# 1 Re: Enter button in Text Box - executes with no results
If you are using ASP.NET v2 you can use the DefaultButton property of the panel control.

http://msdn2.microsoft.com/en-us/library/system.web.ui.webcontrols.panel.defaultbutton.aspx
CapilanoSpur at 2007-11-11 23:11:46 >
# 2 Re: Enter button in Text Box - executes with no results
Unfortunately, I'm using v1...
kcyxa at 2007-11-11 23:12:46 >