Programming C# C++ (7) Delphi (617) Java (8) JavaScript (31) Document (8) Events (8) ExtJS (9) Strings (3) perl (9) php (4) VBScript (1) Visual Basic (1)
Exchange Links About this site Links to us 
New related comments Number of comments in the last 48 hoursHow to prompt the user with an inputbox in Javascript 2 new comments
|
Disable text selection with the mouse
11 comments. Current rating: (3 votes). Leave comments and/ or rate it.
Question: How can I disable text selection by mouse clicking or dragging of a text block?
Answer: You could disable any mouse-down event with code as shown below (to be put in an onload event. The downside of this is that nothing will work anymore, not even clicks on links.
Also know that a user still can click on the document and use 'Select All' from the Edit menu (or in Internet Explorer even use a shortcut Control+A), followed by 'Copy' from the menu.
There is simply no way to protect displayed content, you can only make it a bit more difficult.
 | |  | |
if (document.all)
document.onselectstart =
function () { return false; };
if (document.layers) {
document.captureEvents(Event.MOUSEDOWN);
document.onmousedown =
function (evt) { return false; };
}
document.onmousedown = function () { return false; };
| |  | |  |
Comments:
|
anonymous from Malaysia
|
|
|
|
thanks
|
|
anonymous from United States
|
 |
|
|
koszi
|
2008-04-12, 08:45:30 (updated: 2008-04-12, 08:48:41) |
anonymous from United States
|
|
|
Check out the tool at http://www.enc.rypt..select.php also. It is an alternative method to using Javascript to disable selecting text on a web page.
The tool there inserts invisible characters into text which make it near impossible to copy and paste text.
Javascript can easily be turned off on the browser, rendering any Javascript disabled.
|
|
|
|
|
I added a photo of someone that I was trying to find out if he is a SCAMER or not . Do you post them for all to see ? Or only use it as a TEST PHOTO ? That is how I sent it I guess I am not sure how this site works, So if you would please let me know how to work it , I really need to know about this person as I may have been a SUCKER for to long! Light Roves is the name he is from Ghana Africa As I see many Woman from Ghana that have SCAMED many men and it is wrong as this may be the case for me with this man I am not sure any Truth would be of great help! Thanks 'Miss Don't want to be WRONG'
|
2008-10-05, 08:35:01 (updated: 2008-10-05, 08:35:56) |
anonymous from United States
|
 |
|
|
Listen sweetheart you should post the email letters and all the pics you have of this guy 90% sure this guy is a scam if you want help you can get it from this site. people will help here jake
|
|
anonymous from United States
|
 |
|
|
Hello ! Jake thanks for the reply today is Jan 08, 2009 . I am just reading it today before I could not find it. Anyway I told him I wanted his E-mail password and he gave it to me so I went in to it and BOY did I get more then I wanted too ! I found many E-mails 's to other woman and well I don't think I need to say anymore now that I no longer send him funds or anything I don't here from him anymore So I guess I was right ALL THE LONG !!! This went on long enough almost 4 years . Well I guess I learned alot from this ~! Thank you again , I just don't understand why men do this (it is mostly men that scame) ? P.S I also sent a letter to his Pastor asking him for info about Light Roves A.K.A. Light Sevor because if he was going to come to the United States I want'ed to make sure what he was saying was real and I have two boys at home so I was not just going to bring him here without getting a letter from his pastor the last phone call from him was on 12/31/08 Take Care , Miss WRONG & SUCKERED
|
|
anonymous from China
|
|
|
|
very good. i need it
|
|
anonymous from Poland
|
|
|
|
back:
document.onmousedown = null;
document.onselectstart = null;
|
|
anonymous from United Arab Emirates
|
|
|
|
usefull
|
|