Hi Everybody

I want to disable Control Key on iframe ?

Please Help

If by control key you mean the key on the keyboard, you cannot with PHP.

While it is possible to disable keys using Javascript, the user turning off Javascript would render this useless.

Why would you want to disable a key anyway?

Yes i want it to disable control on iframe using javascript but i was not able to do that..

Generally speaking, you should not (as a web developer) be attempting to alter the browser functionality.

There are very few cases where this should be considered acceptable.

If you are interested in the javascript, a very quick Google search will tell you what you need to know.

commented: Agreed. +14

Yes i did google but i was not able to find out the solution,if u have any pointers please let me know

Thanks

Hi We have done a lot on disable copy paste
at last we have done it.

Here is the code

<script language="javascript">
var IFRAME_test = null;



function OnCrmPageLoad()
{
    //Set Object Variable
    IFRAME_test = document.all.IFRAME_test; 

    //Attach to the change event
    IFRAME_test.attachEvent( "onreadystatechange" , OnIframeTestReady );
    IFRAME_test.src = getFrameSource('new_abcs_new_tests');
}

function OnIframeTestReady()
{
    //Override the onmousedown event
    IFRAME_test.contentWindow.document.onmousedown = function(){
                alert("This iframe is ReadOnly");
                return false;
    };
}



getFrameSource = function( tabSet ) 
{
   if (crmForm.ObjectId !=null) 
   {
      var oId = crmForm.ObjectId;
      var oType = crmForm.ObjectTypeCode;
      var security = crmFormSubmit.crmFormSubmitSecurity.value;
            return "areas.aspx?oId="+ oId + "&oType=" + oType + "&security=" + security+ "&tabSet=" + tabSet;
   }
   else 
   {
      return "about:blank";
   }
}

call this on

<body onload="openPdf()" onload="OnCrmPageLoad()" onload="OnIframeTestReady()" onload="function( tabSet )">

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.