Solved

how to make Mozilla contenteditable working

Posted on 2004-10-17
6
837 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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Website Home page blank 4 26
Cannot scroll down on html page 2 26
html input clean up 3 32
Apostophes in PHP generated form 6 17
Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
Someone recently asked me about how to display a progress indicator on a page while an iframe is loading. And I remember when I first came across this myself. It was a bit tricky to get my head around, but really, it's very simple. The most impor…
In this tutorial viewers will learn how to style a corner ribbon overlay for an image using CSS Create a new class by typing ".Ribbon":  Define the class' "display:" as "inline-block": Define its "position:" as "relative": Define its "overflow:" as …
In this tutorial viewers will learn how to embed Flash content in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <object> tag to embed Flash content.: To specify that the object is Flash content, d…

757 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now