htmlArea

A directory of browser-based WYSIWYG editors

  MAIN
INDEX
SEARCH
POSTS
WHO'S
ONLINE
LOG
IN

Home: htmlArea 2: htmlArea 2 & 3 archive (read only): htmlArea v2.0:
Disable right click and keyboard


The htmlArea 2 & 3 editors have been discontinued.

We've made these forums available as a read-only reference and knowledge-base for people using or developing editors based on htmlArea 2 or 3.

Anyone who is interested in taking over version 2 or 3 is free to do so. All we ask is that you choose a new name that doesn't have "htmlarea" in it to avoid confusion with this site. We'll even give you a link in the directory to make it easier for people to find you. If you are developing or hosting an htmlArea based-editor under a new name, please submit it to our directory.

 


ellasisking
New User

Jan 19, 2005, 5:48 PM

Post #1 of 3 (2070 views)
Shortcut
Disable right click and keyboard Can't Post

I realize this may not make sense to do for a text editor, but I need to disable the right mouse button and the keyboard in the textArea box. Disabling these on the page does not disable them within the htmlArea editor. The reason I need to be able to do this is becasue I will be loading predefined text that the user will be able to "mark for deletion" or "insert new text" through a separate box. I am trying to implement a track changes functionality. ex: red-strikethrough=deleted, blue=added, black=original.


theauthor
Novice

Jan 25, 2005, 11:47 AM

Post #2 of 3 (2039 views)
Shortcut
Re: [ellasisking] Disable right click and keyboard [In reply to] Can't Post

The following should point you in the right direction. You'll have to do the research for the rest.

document.all["_"+name_of_textarea+"_editor"].contentWindow.document

The above is the DOM path to the document contained in the htmlArea iframe. Dealing with the clicks and types is up to you.


Luis
Veteran

Jan 29, 2005, 12:03 AM

Post #3 of 3 (2006 views)
Shortcut
Re: [ellasisking] Disable right click and keyboard [In reply to] Can't Post

Hi ellasisking:

To cancel the keyboard, find this line in editor.js:
editdoc.onkeypress = function() { editor_event(objname); }

and change it to:
editdoc.onkeypress = function() { editor_event(objname); return false;}

just below, add:
editdoc.body.oncontextmenu = function() { editor_event(objname); return false;}

to cancel the context menu.

Greetings


Don't give up!!
http://webstationone.com/test/htmlarea


(This post was edited by Luis on Jan 29, 2005, 12:04 AM)

 
 
 


Search for (options)