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

    Hi,

    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.

    thanks
    Ron.
  2. Answer
    Princy
    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.

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

    Hope this helps.

    Thanks,
    Princy.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. 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