View Full Version : Disable select-text and Mozilla

09-16-2004, 08:09 AM
Script: Disable select-text (http://www.dynamicdrive.com/dynamicindex9/noselect.htm)

The script "Disable select-text" has a secondary effect in Mozilla (but not in IE), it precludes the use of formularies and text boxes.

Is there any solution for Mozilla to use formularies and preclude text copy?


09-16-2004, 09:38 AM
I see the problem with form elements in NS6+. Not sure what you mean by formularies though?

Either way, it's possible to modify the script to exclude form elements in NS6+. If there's a demand for this, I can go ahead and update the script for this. Unfortunately NS6+ doesn't support the "onselectstart" event, so some manual detection is required.

09-16-2004, 10:45 AM
I think that you have understood the problem. It seems that "formularies", as I have used it, is a bad traslation of spanish. The correct word must be forms.

An example of what I mean is the search box that is in the top of the following page:

If you include the Disable select-text in this page, then the mozilla user can not write in this box.

I would thank you If you can update the script. I think I am not the only one with this problem, but the first that have written in the right forum. See for example:

http://www.programacion.com/foros/3/msg/130697/ (In spanish)

Searching with google I find that several sites that according google had the script have deleted it.

1) Write in google: "Disable select-text" Mozilla
2) and look the links like

If you consider that there is not enough demand for the upgrade I would thank you if you gime me any guess to do the modifications by myself.


09-16-2004, 08:00 PM
Ok, I'll post an update to the script tomorrow that will, in NS6+, omit all form elements. This means that form elements will be selectable in NS6+ while regular text won't. This should be fine, as seldom would you want to disable the ability to select text inside a form, as it's crucial to editing it.

09-17-2004, 09:24 AM
Here you go. Script rewritten for the change above: http://www.dynamicdrive.com/dynamicindex9/noselect.htm

09-17-2004, 03:29 PM
Thank you very much for your quick and fruitful help. The new script works in Mozilla quite well.


10-22-2004, 03:15 AM
Disable Text Select (http://www.dynamicdrive.com/dynamicindex9/noselect.htm)

Hi! New to the forum with an oddity for your perusal and amusement.

I've implemented the newest version of this script on my site and it works perfectly in IE, as expected.

Tesla-PC/NYC (http://tesla-pc.com)

It's when I look at the site in Firefox 1.0 that things begin to get hinky.

It works perfectly on my front page and main section pages. It's when we get into a content page, like this one (http://tesla-pc.com/services/maintain/defense.htm), that things get "interesting".

It still disables a user's ability to select my menus left and sidebar info--not as helpful as you might think--but appears to still allow them to select the primary content, the meat of the article.

Any thoughts? I don't see anything in the code of either my page or the script, at least nothing that's screaming, "HERE", at me, so...I'm wide open.

There is a small--I mean miniscule--date/time stamp javascript on the lower right; could that be the problem?

10-22-2004, 05:35 AM
Hmm, i'm using FireFox 1.1 and I can select everything on your content page example.


10-22-2004, 11:04 PM
This is what I'm saying.

10-23-2004, 06:26 AM
As far as I have found, no right-click disable scripts really work in FireFox.

For example, www.mess.be has a script which trys to stop right-click, but you only need to press the spacebar to disable the script when the alert appears.


10-26-2004, 01:31 AM
My point is why does it work sometimes on some of my pages and not on others; the script prior to the forms revision did seem to work across the board--nothing could be selected.

And in somecases, including my sample page above, you CAN select the text of the article, but not the text in the menu on the left.

See what I mean?

10-26-2004, 06:54 AM
Not really- I can select everything, including the menu on the left.

I use FireFox 1.1, nightly build.

The point I'm trying to make is that no "function disabling" scripts work on everything any more to the best of my knowledge.


10-27-2004, 02:07 AM
If your page contains a form element that's listed in the script's exclusion list:

var omitformtags=["input", "textarea", "select"]

This could cause problems in Firefox as far as making even regular text selectable. It's a tradeoff for not disabling text selection in form elements in Firefox, which could make forms unusable. I'm not aware of any immediate fix to this conflict in Firefox. In IE, it's much simplier due to its support of a certain event handler ("onselectstart").

10-29-2004, 04:33 PM
Yeah, I know this is only a stop gap; anyone who really wants to copy my content will find a way (and they have, believe me, though, for the life of me I don't get it--I'm just not that good). Disable JS, save the page, look at their cache--we've all heard this before. There is no sure way--short of not posting it at all--to protect your content once it's on the 'Net.

Just thought it was curious that the code appears works on some parts and not others. Our host makes an excellent point about the types of tags his code will and won't affects--very straightforward.

Because there's a small search form atop each page, a script that disabled select while allowing form entry seemed ideal. What if I changed the newer limitation (for my purposes only) to only allow input? What would the repercussions be, do ya suppose?

This is all part of the fun of computing for me; finding a need (stop copying my darn page) and looking at possible solutions, like these great DD scripts. I'm havin' fun! Woo-hoo!

Thanks to all for looking at it--much appreciated.

01-31-2005, 02:42 AM
I just had to revive this post....
All scripts that block drag n drop and text select in IE and Netscape make Firefox NOT allow form use!
This is clearly a Firefox bug (one more to the endless list).

Now, how do I have drag and drop, text select, disable for all browsers (even firefox), but still being able to use the forms?

02-16-2005, 07:18 PM
Bit of an update:

I've gotta tell you, since I installed this script several months ago, I haven't had a single copyright infringer <knocks wood>.

I think it illustrates the point that people like us, if confronted with a script like this on a page we wanted to copy, would know HOW to disable the js.

The kids (and they are mostly young kids) who infringed on my copyrights apparently do not have that knowledge.

In that sense, while the script is not bulletproof, it is still very effective for the prevention of this kind of agita. Yeah, I put up a link to the Copyscape anti-infringement site on the bottom of each page and added a Copyright Policy page, but I think the credit goes to the DD script more than anything else.

Thanks again, and keep up the good work!

02-23-2005, 12:33 PM

Excuse me for my english.

The script doesn't work in Mozilla when you use php-nuke.
You can't select text in the menu but you can do it in the articles.


Any help?


05-18-2005, 02:01 PM
I have testet the script and I can see that text surrounded by the < p > < /p> tag isn't protectet by the scrip in firefox v 1.0.4. Is there any way to fix this :confused:

Troy III
03-05-2006, 05:58 PM
I have testet the script and I can see that text surrounded by the < p > < /p> tag isn't protectet by the scrip in firefox v 1.0.4. Is there any way to fix this :confused:
Firefox doesn't support disable-select select event natively, the script was a workaround. It simply cancels the mousedown event, this way interrupting the text selection from working on some or all elements. I have similar problems with some page lements that need to be unselectable in order to respond properly but I haven't solved this issue for firefox yet.

03-05-2006, 06:12 PM
The script just wasn't written too well to begin with. In FF it excludes any tags that appear in an exclude string. Since this sting has 'input' in it, the p in <p matches the p in 'input' and is also excluded, I made an updated version here that works and has refinements for IE which previously couldn't exclude anything:


This still is a silly idea unless the functionality of your page hinges on noselect. Having noselect for content protection is useless as that content is available in tons of other ways easily found by anyone who is the least bit persistent. Also, its use for page functionality is somewhat compromised by FF's ability to ignore it.