Showing posts with label php. Show all posts
Showing posts with label php. Show all posts
August 15, 2013
August 9, 2013
Disable Ctrl+C ,Ctrl+V ,Ctrl+A in a web page : Javascript
Question How to disable Ctrl+C , Ctrl+V , Ctrl+A in any web page by using javascript.
More..
Disable Button after clicking on it.
Solution:
just copy and paste below script in <head> section
and call the function in html body
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgMc0nrwVoeewJGGyEI_xWVYV-TYVBlHuzS9aOnzSE4b2lcrhFupNY4_WAJMKupCBVYEKE1PxaKNEv7WGMGzPUHgCn5WhjiHND7NvQLWfp4hhDKPADCB-3jGiK9pwnNnFJY3ZAtDej1O0pP/s200/JavaScript-logo%255B1%255D.png)
Disable Button after clicking on it.
Solution:
just copy and paste below script in <head> section
<script type="text/javascript">
function Disable_Control_C() {
var keystroke = String.fromCharCode(event.keyCode).toLowerCase();
if (event.ctrlKey && (keystroke == 'c' || keystroke == 'v' || keystroke == 'a')) {
alert("This function not allowed");
event.returnValue = false; // disable Ctrl+C
}
}
</script>
and call the function in html body
<body onkeydown="javascript:Disable_Control_C()">
Hello World!
</body>
</html>
August 7, 2013
Disable Right Click Button - Javascript
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjeNYLf1lUOMw7q5ynh26KjBJjdx44E8xFEA_dBdFCdoXfSHdbC8dSBjV_im5-XE-tW7gQF8vECOf0aMtrYe0GEaCjwrQVVKm02tBGBrzQrd0oa0cD9ew9GxJdoX4ZdKq_k1FwT5-T2HMC8/s200/Javascript.png)
Qusetion - How to disable right click button of mouse in webpage.
Solution-
add below script in head section of web page
<script type="text/javascript">
var msg = "This function is disabled!";
var bV = parseInt(navigator.appVersion)
var bNS = navigator.appName == "Netscape"
var bIE = navigator.appName == "Microsoft Internet Explorer"
function nrc(e) {
if (bNS && e.which > 1) {
alert(msg)
return false
} else if (bIE && (event.button > 1)) {
alert(msg)
return false;
}
}
document.onmousedown = nrc;
if (document.layers) window.captureEvents(Event.MOUSEDOWN);
if (bNS && bV < 5) window.onmousedown = nrc;
</script>
..........................................................................................Read Also...
How to prevent page going back on backspace button click
Subscribe to:
Posts (Atom)