This is a migrated thread and some comments may be shown as answers.

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

2 Answers 338 Views
Button
This is a migrated thread and some comments may be shown as answers.
Ron
Top achievements
Rank 1
Ron asked on 27 May 2012, 07:23 PM
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 Answers, 1 is accepted

Sort by
0
Accepted
Princy
Top achievements
Rank 2
answered on 28 May 2012, 05:59 AM
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.
0
Anitha
Top achievements
Rank 1
answered on 13 Dec 2015, 01:58 PM
Am using radbutton in all the modules .. enter key is not triggered.
Tags
Button
Asked by
Ron
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Anitha
Top achievements
Rank 1
Share this question
or