OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

Disable text selection, copy, cut and paste in Google forms through Google Apps Script

  • Thread starter Thread starter Robur_131
  • Start date Start date
R

Robur_131

Guest
I'm trying to disable text selection, copy, cut and paste in Google Forms. This is not possible by default in Google Forms but you can add this functionality through Google Apps Script by calling a JavaScript function.

I am not familiar with JavaScript. I opened the apps script editor and found a single file Code.gs. I looked around the internet and found a JavaScript function to disable select which I pasted in the Code.gs file:

Code:
    function disableSelect(event) {
       event.preventDefault();
    }

But when I run the file, it prompts the error: Typerror: Cannot read property 'preventdefault' of undefined. What am I doing wrong and how can I implement the rest of the functionalities?

<p>I'm trying to disable text selection, copy, cut and paste in Google Forms. This is not possible by default in Google Forms but you can add this functionality through Google Apps Script by calling a JavaScript function.</p>
<p>I am not familiar with JavaScript. I opened the apps script editor and found a single file <code>Code.gs</code>. I looked around the internet and found a JavaScript function to disable select which I pasted in the <code>Code.gs</code> file:</p>
<pre><code> function disableSelect(event) {
event.preventDefault();
}
</code></pre>
<p>But when I run the file, it prompts the error: <code>Typerror: Cannot read property 'preventdefault' of undefined</code>. What am I doing wrong and how can I implement the rest of the functionalities?</p>
 

Latest posts

Top