Comments? Feedback?

This wiki does not yet support public comments (a limitation of Google Sites), so we encourage you to post your comments either:

On Twitter by responding to @orbeon.

On our community mailing list: subscribe sending an email to ops-users-subscribe@ow2.org (content of subject/body doesn't matter), you'll get a response with the email to use to send your message to the community mailing list.

Recent site activity

How-to guides‎ > ‎XForms View‎ > ‎

Capture rich HTML text

The problem

You need to enter rich text data in your form.

The solution

Use the text/html mediaype on <xforms:textarea>:

<xforms:textarea mediatype="text/html" ref="."/>

Instead of a plain text area, this triggers the use of a rich text editor:

When using the text/html mediaype, the resulting HTML is escaped in the XForms instance:

<htmlarea>&lt;div style="text-align: left;"&gt;&lt;b&gt;Pyotr Ilyich
Tchaikovsky&lt;/b&gt;&lt;a shape="rect"
...
Commons Attribution-ShareAlike License&lt;/a&gt;;
additional terms may apply.&lt;br clear="none"/&gt;&lt;/div&gt;</htmlarea>

Also, Orbeon Forms performs clean-up of the resulting HTML for security reasons, to help prevent cross-site scripting (XSS) attacks.

NOTE: Orbeon Forms uses the YUI Rich Text Editor to implement this feature.

Run it and get the source