Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>To disable not only control-s but others, I found this:</p> <pre><code> function disableCtrlModifer(evt) { var disabled = {s:0}; var ctrlMod = (window.event)? window.event.ctrlKey : evt.ctrlKey; var key = (window.event)? window.event.keyCode : evt.which; key = String.fromCharCode(key).toLowerCase(); return (ctrlMod &amp;&amp; (key in disabled))? false : true; } </code></pre> <p>Taken from here: <a href="http://www.arraystudio.com/as-workshop/disable-ctrl-n-and-other-ctrl-key-combinations-in-javascript.html" rel="nofollow">http://www.arraystudio.com/as-workshop/disable-ctrl-n-and-other-ctrl-key-combinations-in-javascript.html</a></p> <p>You can modify it to suit your needs. Although I don't know what "keyBinding" is, here's how I would plug it into your code:</p> <pre><code>&lt;!DOCTYPE html&gt; &lt;html&gt; &lt;head&gt; &lt;script type="text/javascript" src="Charts/js/jquery-1.6.2.js"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; function disableCtrlModifer( evt ) { var disabled = { s:0 }; // You can add more keys here :) var ctrlMod = ( window.event ) ? window.event.ctrlKey : evt.ctrlKey; var key = ( window.event ) ? window.event.keyCode : evt.which; key = String.fromCharCode( key ).toLowerCase(); return ( ctrlMod &amp;&amp; (key in disabled) ) ? false : true; } $( document ).ready(function() { $( "[id^='formCtrl']" ).each(function() { var me = $( this ); var myId = me.attr( "id" ); var keyBinding = myId.replace("form", "").replace( /(.{4})/g,"$1+" ); //$(document).bind( "keydown keypress keyup", disableCtrlModifer ); me.find( "input" ).each( function() { $( this ).bind( "keydown keypress keyup", keyBinding, disableCtrlKeyCombination ); }); }); }); &lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;form id="formCtrl-123" method="get"&gt; &lt;input type="text" name="test1" value="" /&gt; &lt;/form&gt; &lt;/body&gt; &lt;/html&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. This table or related slice is empty.
    1. VO
      singulars
      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