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

Enter key

Hi,
Here is the situation that i have a form which has Search and also Login Text Boxes. But for Search i have a button which should be clicked after enter key pressed. and the same time if i give login id and press enter then it should work login button. Can u help me.
[279 byte] By [felix] at [2007-11-11 7:13:59]
# 1 Re: Enter key
You'll have to add JavaScript to submit the appropriate form when the Enter key is pressed in each textbox. See if this helps: http://weblogs.asp.net/rajbk/archive/2003/12/11/43023.aspx
Phil Weber at 2007-11-11 23:13:49 >
# 2 Re: Enter key
Or since both are buttons you can have one event handler method for both the buttons and based on which textbox was populated with text you can do a search or login ? then you may not need to do any javascript and the decision can be made on the server
srinivas_s at 2007-11-11 23:15:00 >