Disable cut copy paste on text box
Question

I am trying to disable cut copy paste in textbox in reactive/mobile application.

I have already tried the extended property and javascript

Its not working.

Need help from the community guys


Thanks,

Krunal

Hi Krunal,

Try running the following JavaScript in the OnReady of your screen:

document.querySelector("#" + $parameters.inputId).addEventListener("copy", function(event) {

         event.preventDefault();

}, false);


document.querySelector("#" + $parameters.inputId).addEventListener("cut", function(event) {

         event.preventDefault();

}, false);


document.querySelector("#" + $parameters.inputId).addEventListener("paste", function(event) {

         event.preventDefault();


}, false);


Where inputId is the Id of the textbox you're trying to prevent from being copy/cut/pasted:


Hope that helps.

Hi Krunal,

adding to Jeroen suggestion, a shorter version of his solution.

https://www.outsystems.com/forums/discussion/49770/block-copy-paste-on-mobile-app/

Regards

Thanks Guys
It worked

Apparently i was doing some syntax mistakes.


Thanks,

Krunal

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.