title: How disable Ctrl+A,Ctrl+C key functions in iframe
body: <p>I need to disable ctrl+c and other ctrl options inside iframe how to achieve this </p>
  
  <p>i got code for disabling in webpage but its not working inside iframe. How to change this </p>
  
  <pre><code>    &lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
  &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
  &lt;head&gt;
  &lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8" /&gt;
  &lt;title&gt;Untitled Document&lt;/title&gt;
  
  &lt;script language="JavaScript"&gt;
  
  //////////F12 disable code////////////////////////
      document.onkeypress = function (event) {
          event = (event || window.event);
          if (event.keyCode == 123) {
             //alert('No F-12');
              return false;
          }
      }
      document.onmousedown = function (event) {
          event = (event || window.event);
          if (event.keyCode == 123) {
              //alert('No F-keys');
              return false;
          }
      }
  document.onkeydown = function (event) {
          event = (event || window.event);
          if (event.keyCode == 123) {
              //alert('No F-keys');
              return false;
          }
      }
  /////////////////////end///////////////////////
  
  
  //Disable right click script 
  //visit http://www.rainbow.arch.scriptmania.com/scripts/ 
  var message="Sorry, right-click has been disabled"; 
  /////////////////////////////////// 
  function clickIE() {if (document.all) {(message);return false;}} 
  function clickNS(e) {if 
  (document.layers||(document.getElementById&amp;&amp;!document.all)) { 
  if (e.which==2||e.which==3) {(message);return false;}}} 
  if (document.layers) 
  {document.captureEvents(Event.MOUSEDOWN);document.onmousedown=clickNS;} 
  else{document.onmouseup=clickNS;document.oncontextmenu=clickIE;} 
  document.oncontextmenu=new Function("return false") 
  // 
  function disableCtrlKeyCombination(e)
  {
  //list all CTRL + key combinations you want to disable
  var forbiddenKeys = new Array('a', 'n', 'c', 'x', 'v', 'j' , 'w');
  var key;
  var isCtrl;
  if(window.event)
  {
  key = window.event.keyCode;     //IE
  if(window.event.ctrlKey)
  isCtrl = true;
  else
  isCtrl = false;
  }
  else
  {
  key = e.which;     //firefox
  if(e.ctrlKey)
  isCtrl = true;
  else
  isCtrl = false;
  }
  //if ctrl is pressed check if other key is in forbidenKeys array
  if(isCtrl)
  {
  for(i=0; i&lt;forbiddenKeys.length; i++)
  {
  //case-insensitive comparation
  if(forbiddenKeys[i].toLowerCase() == String.fromCharCode(key).toLowerCase())
  {
  alert('Key combination CTRL + '+String.fromCharCode(key) +' has been disabled.');
  return false;
  }
  }
  }
  return true;
  }
  &lt;/script&gt;
  
  
  &lt;/head&gt;
  
  &lt;body onkeypress="return disableCtrlKeyCombination(event);" onkeydown="return disableCtrlKeyCombination(event);"&gt;
  &lt;iframe  src="document" width="1000" height="600"&gt;&lt;/iframe&gt;
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>How to change this to work for iframe.I need to disable CTRL+A CTRL+C CTRL+V etc </p>