press "enter" to fire rad button on click event.

3 posts, 1 answers
  1. Ron
    Ron avatar
    113 posts
    Member since:
    Apr 2011

    Posted 27 May 2012 Link to this post


    I have a login screen with a rad button and everything works fine except after I enter the username and password and press "Enter" nothing happens. Shouldn't "Enter" automatically fire the onclick event? I'd really hate to have my user pick their mouses up and click the button manually.  I really appreciate your help.

  2. Answer
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 28 May 2012 Link to this post

    Hi Ron,

    Try the following code to achieve your scenario.

    <script type="text/javascript" >
        function OnKeyPress(sender, args)
            if (args.get_keyCode() == 13)
                $find("<%=RadButton1.ClientID %>").click();

    Hope this helps.

  3. Anitha
    Anitha avatar
    1 posts
    Member since:
    Dec 2015

    Posted 13 Dec 2015 in reply to Princy Link to this post

    Am using radbutton in all the modules .. enter key is not triggered.
Back to Top