Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# ASP.NET
function AlertIfCapsLockOn(eventArgs) {
 
            var keyCode = eventArgs.keyCode ? eventArgs.keyCode : eventArgs.which;
            var shiftKey = eventArgs.shiftKey ? eventArgs.shiftKey : ((keyCode == 16) ? true : false)
            var isEnabled = CapsLockEnabled(keyCode, shiftKey);
            if (isEnabled) {
 
                toolTip.show();
            }
         }
 
        function CapsLockEnabled(keyCode, shiftKey) {
 
            if (((keyCode >= 65 && keyCode <= 90) && !shiftKey) || ((keyCode >= 97 && keyCode <= 122) && shiftKey))
                return true;
            else
                return false;
 
        }
 
<asp:TextBox ID="Password" runat="server" TextMode="Password" Width="150px" onclick="return AlertIfCapsLockOn(event);return false;"
                                                Height="5px"></asp:TextBox>
                                            <asp:RequiredFieldValidator ID="PasswordRequired" runat="server" ControlToValidate="Password"
                                                ErrorMessage="Password is required." ToolTip="Password is required." ValidationGroup="log">*</asp:RequiredFieldValidator>
                                            <telerik:RadToolTip ID="radtooltip" runat="server" Text="Caps Lock is On" ShowEvent="OnFocus"
                                                TargetControlID="Password" Position="BottomCenter" RelativeTo="Element">
                                            </telerik:RadToolTip>
 
Even CapsLock button is off the tooltip is showing on....,
Posted 27-Dec-12 1:03am
Comments
Hetal Jariwala at 28-Dec-12 1:21am
   
I wonder if you could do this using javascript???
Hetal Jariwala at 28-Dec-12 1:22am
   
Or you can write script which converts lower case to upper case in textbox...

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 383
1 OriginalGriff 304
2 George Jonsson 258
3 Animesh Datta 130
4 Shemeemsha RA 128
0 OriginalGriff 6,099
1 Sergey Alexandrovich Kryukov 5,411
2 CPallini 4,770
3 George Jonsson 3,400
4 Gihan Liyanage 2,522


Advertise | Privacy | Mobile
Web03 | 2.8.140916.1 | Last Updated 28 Dec 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100