How do I change so text can be copied?

I’m trying to change a web script that isn’t allowing copying of the echoed info. I believe it is this line:

<input type="text" value="{{CONFIG site_url}}/watch/<?php echo $pt->get_video->video_id; ?>" class="form-control input-md" readonly onClick=";">

is the “readonly” the part that is blocking the copying?

I look forward to any assistance.

The readonly attribute only prevents the editing of an html INPUT, not the copying of text anywhere. So it’s going to be somewhere else.

Or did you mean giving someone the ability to change a text input field, at which point, then yes, removing that attribute will allow the input field to be altered.

Just a guess

Mostly copy&paste is disable with something like this

<div onmousedown="return false" onselectstart="return false">
1 Like

Note that is is pretty much impossible to do what your you are trying to do. While you can use fancy JavaScript to block the user, all somebody has to do is…
A-View the source code
B-Inspect the site then copy the text from the source code
C-Turn off JavaScript
D-Take an image and run it though text recognition software

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.