Show Caps Lock status on HTML5 client logon

Help us improve our product. Feature requests are welcomed!
Post Reply
Posts: 4
Joined: Thu Mar 02, 2017 8:18 pm

Show Caps Lock status on HTML5 client logon

Post by bblsystems » Thu Jun 17, 2021 3:12 pm

We have users trigger the bruteforce lockout due to bad passwords, and often it's because the caps lock is on.

Maybe you could display a "CAPS Lock is ON" below the password field if caps lock is on.

The Windows logon page will display such a message to help users.

Here's how to display a caps lock status via javascript.

I guess we could just add it to our logon pages ourselves using that technique, but others might benefit it the default config had that.

Site Admin
Posts: 234
Joined: Wed Oct 15, 2014 8:25 pm

Re: Show Caps Lock status on HTML5 client logon

Post by juwagn » Sat Jun 19, 2021 5:06 pm


it hasn't anything to do directly with html5 client logon but is the portal functionality common for native client and html5 client.
For our portal developers following could be useful.

Code: Select all

  (function() {
    var reg = 0, caps = false;

    var isCaps = function(a) {
      if(a) {
        alert("caps is pressed");

    document.addEventListener('keydown', function(evt) {
      if(reg == 0) {
        if(!evt.getModifierState) {
          reg = 1;

          document.addEventListener('keypress', function(e) {
            e = e || window.event;
            var s = String.fromCharCode(e.which || e.keyCode);
            if(s.toUpperCase() !== s.toLowerCase()) {
              isCaps(((s.toUpperCase() === s) && !e.shiftKey) || ((s.toLowerCase() === s) && e.shiftKey)); 
            } //undetectable char pressed
        } else { reg = 2; }
      if(reg == 2) { isCaps(evt.getModifierState('CapsLock')); }
Sincerely yours, JW.
TSplus HTML5 and Java web engineer

Post Reply