Solved

how to make Mozilla contenteditable working

Posted on 2004-10-17
6
846 Views
Last Modified: 2012-05-05
Hello, Currently, I get to know the contentEditable also works in Mozilla firefox. I have seen such examples from internet. But when I try it, it doesn't work. Does any one have some suggestion about my piece of code

<html>
<head>
</head>
<body>

<div style="contentEditable='true';">
Editable area
</div>

</body>
</html>

When I view this code from Mozilla firefox and press F7, there is really the cursor shown on my area of code, but when I type something, nothing inserted in that area. Does any one have some idea how should it work? Thanks a lot in advance!

BR
0
Comment
Question by:SBUH
  • 4
6 Comments
 
LVL 6

Expert Comment

by:superm401
ID: 12516190
Okay, first of all, I haven't quite figured it out yet.  However, I can tell you for certain that F7 has nothing to do with contentEditable, if that feature is implemented at all in Mozilla Firefox, which unfortunately I am beginning to doubt.  Instead, it refers to Caret Browsing, which lets you move through text using a caret cursor, regardless of whether contentEditable is on.  They are totally separate.  Can you give me a page that supports the contentEditable feature on Mozilla Firefox please?

P.S. In your own example, contentEditable is not a valid CSS property, but if it was you would access it like this:

<div style="contentEditable:'true';">
0
 
LVL 6

Accepted Solution

by:
superm401 earned 65 total points
ID: 12516381
I've got it.

Source code below:

<html>
<head>
<SCRIPT src="http://mozile.mozdev.org/mozile/mozileLoader.js">

<TITLE>Content Edit Test</TITLE>
</head>
<body>
<P>
This is a filler paragraph.
<P>
This is a second filler paragraph.
<P>
This is a final filler paragraph.  They are here only to ensure the editing interface does not block the paragraph to be edited.
<P>
<div style="-moz-user-modify: read-write;-moz-user-input: enabled;-moz-user-select: normal;">
Editable area
</div>

</body>
</html>



Note:  The extra text is there only to keep the editing interface in view, as stated.  For it to work, you need to have the whole div and the script tag at the top:

<SCRIPT src="http://mozile.mozdev.org/mozile/mozileLoader.js">

Of course, you can change the start value for the editable text, from "Editable area" to something else.  


For a working demo, see: http://home.comcast.net/~superm40/editdemo.html
0
 
LVL 6

Expert Comment

by:superm401
ID: 12518272
Let me make a slight correction to my earlier comments.  F7 is useful for content editing only in that it can allow you to create a caret cursor if this is not done automatically.
0
 
LVL 6

Expert Comment

by:superm401
ID: 12518278
And the cursor probably won't be created automatically.
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Need output in powershell ( Vertical format) 2 31
send email part1 9 39
Any Way to rotate banner ads from Commission Junction? 2 36
Accordion won't close correctly 5 12
SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
When it comes to write a Context Sensitive Help (an online help that is obtained from a specific point in state of software to provide help with that state) ,  first we need to make the file that contains all topics, which are given exclusive IDs. …
In this tutorial viewers will learn how to style transparent/translucent elements using alpha transparency in CSS Start with a normal styled element, such as a div.: Define its "background-color" property as "rgba (255, 255, 255, .5): The numbers in…
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

679 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question