Press Enter On A Textbox

Discussion in 'ASP .Net' started by A.M, May 31, 2004.

  1. A.M

    A.M Guest

    Hi,

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

    Thanks,
    Alan,
    A.M, May 31, 2004
    #1
    1. Advertising

  2. 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
    Steven Cheng[MSFT], Jun 1, 2004
    #2
    1. Advertising

  3. A.M

    vivichen Guest

    // 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" <> дÈëÓʼþ
    news:...
    > Hi,
    >
    > Can I configure a TextBox in such a way that pressing enter on it

    simulates
    > Clicking on a button ?
    >
    > Thanks,
    > Alan,
    >
    >
    vivichen, Jun 2, 2004
    #3
  4. 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
    Steven Cheng[MSFT], Jun 4, 2004
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Natty Gur
    Replies:
    0
    Views:
    570
    Natty Gur
    Jun 30, 2003
  2. w. jORDAN
    Replies:
    3
    Views:
    3,721
    w. jORDAN
    Jul 22, 2003
  3. Chad Z. Hower aka Kudzu
    Replies:
    1
    Views:
    658
  4. Jie
    Replies:
    7
    Views:
    6,124
    Xavier Pacheco
    Oct 9, 2004
  5. Zeeshan

    Press enter in textbox server control

    Zeeshan, Nov 20, 2003, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    130
    Zeeshan
    Nov 20, 2003
Loading...

Share This Page