Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Press Enter On A Textbox

Reply
Thread Tools

Press Enter On A Textbox

 
 
A.M
Guest
Posts: n/a
 
      05-31-2004
Hi,

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

Thanks,
Alan,


 
Reply With Quote
 
 
 
 
Steven Cheng[MSFT]
Guest
Posts: n/a
 
      06-01-2004
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

 
Reply With Quote
 
 
 
 
vivichen
Guest
Posts: n/a
 
      06-02-2004
// you can try it
document.onkeydown=function(){
var e= event.srcElement;
if(e.id == "textboxname"){
try{
document.getElementById("buttonname").click();
}catch(e){
__doPostBack("buttonname","");
}
}

}

"A.M" <(E-Mail Removed)> дʼ
news:(E-Mail Removed)...
> Hi,
>
> Can I configure a TextBox in such a way that pressing enter on it

simulates
> Clicking on a button ?
>
> Thanks,
> Alan,
>
>



 
Reply With Quote
 
Steven Cheng[MSFT]
Guest
Posts: n/a
 
      06-04-2004

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

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
capturing from text area Shft+Enter, Control+Enter, Alt+Enter and browser issue. HopfZ Javascript 0 08-28-2006 10:11 AM
Help:How to avoid button click event when Enter key is press in a TextBox? Jie ASP .Net 7 10-09-2004 02:12 PM
Can i check user press the <enter> key in multi-line textbox? Chad Z. Hower aka Kudzu ASP .Net 1 01-23-2004 11:10 AM
Q: Textbox press Enter submit form (ASCX version) w. jORDAN ASP .Net 3 07-22-2003 02:41 AM
Re: why datagrid's itemcommand event fired when I press ENTER key in a TextBox Natty Gur ASP .Net 0 06-30-2003 05:39 AM



Advertisments