We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fceb3a3 commit 657d8ebCopy full SHA for 657d8eb
knowledge-base/inputs-disable-copy-paste.md
@@ -58,10 +58,12 @@ To disable the copy and paste functionality in a TextBox and other Telerik Blazo
58
@* Move JavaScript code to a separate JS file in production *@
59
<script suppress-error="BL9992">
60
function preventCutCopyPaste() {
61
- var tb = document.querySelector(".no-copy-paste input");
+ var input = document.querySelector(".no-copy-paste input");
62
63
- tb.oncopy = e => e.preventDefault();
64
- tb.onpaste = e => e.preventDefault();
+ if (input) {
+ input.oncopy = e => e.preventDefault();
65
+ input.onpaste = e => e.preventDefault();
66
+ }
67
}
68
</script>
69
0 commit comments