Re: in defense of contentEditable - demo

Robert Koberg <rob@koberg.com> wrote:

> I am trying to get the w3c-html wg to look at adding
> contentEditable to the standard

I'm quite aware of how it works! The contentEditable attribute is:

  - simple,
  - convenient,
  - useful,
  - completely unsuited to being part of a standard HTML.

As others have pointed out, editing is useless unless the result of the
editing can be submitted to a server. This simply cannot be done for
arbitrary elements in HTML: only forms can be submitted. The only way
to submit the content from a non-form-field contentEditable element is
to use client-side scripting to extract it first.

A contentEditable attribute is useless without scripting. Making it
necessary for all browsers to include client-side-scripting, an
HTML-editing component and serialiser just to implement simple HTML forms
is highly undesirable. It is also completely backwards incompatible.

If I were to suggest a way to allow HTML content to be edited and submitted
to a form handler, I'd definitely want to do it by extending existing form
elements. One obvious syntax that comes to mind would be:

  <textarea name="foo" type="text/html" cols="bar" rows="baz">
    blah &lt;em> blah &lt;/em> blah
  </textarea>

'type' defaulting to "text/plain" of course. Older browsers and browsers
that do not contain an HTML-editing component can happily let the user
edit the HTML source, and everyone's happy.

I don't know what approach the XForms team will be taking, though.

-- 
Andrew Clover
mailto:and@doxdesk.com
http://and.doxdesk.com/

Received on Thursday, 10 January 2002 09:22:18 UTC