hi Vishwanathan,
If i understand your problem properly, you want click button 2 when user is
in box2 and press enter and same for text box 1/button 2 combination.
If this is the problem, then the solution is pretty simple.
server side:
textbox1.Attributes.add("onkeypress","ClickAddButt on('button1');")
textbox2.Attributes.add("onkeypress","ClickAddButt on('button2');")
javascript
:
function ClickAddButton(buttonId)
{
if(event.keyCode == 13)
{
event.returnValue=false;
event.cancel = true;
document.getElementById(buttonId).click();
}
}
regards
Ural
"Vishwanathan Raman" wrote:
Hi
I am building a Search Interface.It has two text boxes (box1 and box2) and
two buttons (btnbox1 and btnbox2) in the ASPX page.
Example
User keys in a search text in box2 and presses the Enter key. How to
identify that page was submitted becoz the User pressed the enter key when he
was in box2.
Currently in the page load I see which box is empty and then take respective
action but this is not desirable.
Kindly let me if this can be achieved.
Regards
Vishwanathan