Press Enter On A Textbox

  • Thread starter Thread starter A.M
  • Start date Start date
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,
 
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
 
// you can try it
document.onkeydown=function(){
var e= event.srcElement;
if(e.id == "textboxname"){
try{
document.getElementById("buttonname").click();
}catch(e){
__doPostBack("buttonname","");
}
}

}
 
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
 
Back
Top