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
More..
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
while developing web application ,some situation arises where we have to disable right click button of a mouse in web pages of Asp.Net,PHP ,JSP. you can achieve this by using Javascript.
Qusetion - How to disable right click button of mouse in webpage.
Solution-
add below script in head section of web page
Read Also...
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)