Press Enter On A Textbox

A

A.M

Hi,

Can I configure a TextBox in such a way that pressing enter on it simulates
Clicking on a button ?

Thanks,
Alan,
 
S

Steven Cheng[MSFT]

Hi Alan,

I'm viewing this issue and find the question is actually the same with
another thread titled
"Default Button" in this newsgroup. I've posted my reply and provide some
related web resources there. I'd appreciate if you have a look there. Also,
if you feel it convenient that we continue to discuss in that thread,
please feel free to followup there. Thanks.


Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx
 
V

vivichen

// you can try it
document.onkeydown=function(){
var e= event.srcElement;
if(e.id == "textboxname"){
try{
document.getElementById("buttonname").click();
}catch(e){
__doPostBack("buttonname","");
}
}

}
 
S

Steven Cheng[MSFT]

Hi Alan,

Have you had a chance to check out the suggestions in my last reply or have
you got any further ideas on this issue? If you have anything unclear or if
there're anything else we can help, please feel free to post here. Thanks.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,899
Latest member
RodneyMcAu

Latest Threads

Top