343
Views
3
Comments
Solved
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

2022-07-11 14-05-36
Jeroen Barnhoorn
Solution

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.

2021-04-17 09-53-48
José Gonçalves

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

2021-07-14 10-21-07
Krunal Vyas

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.