Solved

how to make Mozilla contenteditable working

Posted on 2004-10-17
6
850 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

[Live Webinar] The Cloud Skills Gap

As Cloud technologies come of age, business leaders grapple with the impact it has on their team's skills and the gap associated with the use of a cloud platform.

Join experts from 451 Research and Concerto Cloud Services on July 27th where we will examine fact and fiction.

Question has a verified solution.

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

Find out what you should include to make the best professional email signature for your organization.
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
In this tutorial viewers will learn how to position overlapping items using z-index in CSS. They will also learn the restrictions on the z-index property.  Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Red.…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

636 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