Solved

how to make Mozilla contenteditable working

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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
need help with share buttons 11 106
Triple line in an alert message 4 37
HTML INPUT 6 39
center text in div with CSS3 2 31
Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this. Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it i…
Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…

751 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