Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You can find a decent example of how to do this here: <a href="http://www.codeproject.com/KB/scripting/Detect_Caps_Lock.aspx" rel="nofollow">http://www.codeproject.com/KB/scripting/Detect_Caps_Lock.aspx</a></p> <p>You could take that code and wrap it into a different kind of event, either, i.e. onfocus or on document load.</p> <p>You can google for an index of key codes (I'd post a link, but I don't have high enough karma to post more than one link, sorry).</p> <p>For simplicity the codes you'd be looking for is 20 (Caps lock).</p> <hr> <p>Instructions copied here from site (license: <a href="http://www.codeproject.com/info/cpol10.aspx" rel="nofollow">CPOL</a>)</p> <h2>Building the script</h2> <pre><code>&lt;script language="Javascript"&gt; function capLock(e){ kc = e.keyCode?e.keyCode:e.which; sk = e.shiftKey?e.shiftKey:((kc == 16)?true:false); if(((kc &gt;= 65 &amp;&amp; kc &lt;= 90) &amp;&amp; !sk)||((kc &gt;= 97 &amp;&amp; kc &lt;= 122) &amp;&amp; sk)) document.getElementById('divMayus').style.visibility = 'visible'; else document.getElementById('divMayus').style.visibility = 'hidden'; } &lt;/script&gt; </code></pre> <p>Now we have our script ready to go. We now need to associate this script with our form.</p> <h2>Using the script</h2> <p>Let's add two items: a textbox and a DIV. Now we just need to call the onKeyPress event.</p> <pre><code>&lt;input type="password" name="txtPassword" onkeypress="capLock(event)" /&gt; &lt;div id="divMayus" style="visibility:hidden"&gt;Caps Lock is on.&lt;/div&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload