block copy/paste for textbox in firefox
-
hi , how can i block copy/paste option (or) right click for a text box in firefox both in keyboard and right click option in mouse... its working in IE...
Ashok
-
hi , how can i block copy/paste option (or) right click for a text box in firefox both in keyboard and right click option in mouse... its working in IE...
Ashok
-
hi, ur code is working in IE but not in firefox... I ve tried this already... Any idea
Ashok
-
hi , how can i block copy/paste option (or) right click for a text box in firefox both in keyboard and right click option in mouse... its working in IE...
Ashok
use this javascript: function noCopyKey(e) { var forbiddenKeys = new Array('c','x'); var keyCode = (e.keyCode) ? e.keyCode : e.which; var isCtrl; if(window.event) isCtrl = e.ctrlKey else isCtrl = (window.Event) ? ((e.modifiers & Event.CTRL_MASK) == Event.CTRL_MASK) : false; if(isCtrl) { for(i = 0; i < forbiddenKeys.length; i++) { if(forbiddenKeys[i] == String.fromCharCode(keyCode).toLowerCase()) { alert('This action has been restricted, for more information contact MJM'); return false; } } } return true; }
-
use this javascript: function noCopyKey(e) { var forbiddenKeys = new Array('c','x'); var keyCode = (e.keyCode) ? e.keyCode : e.which; var isCtrl; if(window.event) isCtrl = e.ctrlKey else isCtrl = (window.Event) ? ((e.modifiers & Event.CTRL_MASK) == Event.CTRL_MASK) : false; if(isCtrl) { for(i = 0; i < forbiddenKeys.length; i++) { if(forbiddenKeys[i] == String.fromCharCode(keyCode).toLowerCase()) { alert('This action has been restricted, for more information contact MJM'); return false; } } } return true; }
hi, thanks 4 ur reply... this code is working to block on keyboard to copy/paste... But i cannot block right click and paste from mouse button...
Ashok
-
hi, thanks 4 ur reply... this code is working to block on keyboard to copy/paste... But i cannot block right click and paste from mouse button...
Ashok