By default, the text area control is rendered as a regular multi-line text area:
Multi-line text area in Orbeon Forms
With the standard appearance, the following attributes are available:
xxf:cols: same as HTML input
colsattribute (prefer using CSS for this)
xxf:rows: same as HTML input
rowsattribute (prefer using CSS for this)
xxf:maxlength: same as HTML 5 input
maxlengthattribute (not all browsers support this attribute, and some have bugs)
You can add the
appearance="xxf:autosize"attribute on the
<xf:textarea>to get the textarea height to automatically adjust to its content.
[SINCE Orbeon Forms 2017.1]
The label or hint associated with
<xf:textarea>may have the
This causes either the label or the hint to appear on the background of the field when it is empty. If both the label and hint have a
minimalappearance, the label wins.
Orbeon Forms leverages the HTML 5
placeholderattribute for browsers that support it (Firefox 3.5+, Chrome, Safari, Opera), and simulates the HTML 5
NOTE: This works the same as the per-form properties for
oxf.xforms.hint.appearance(or the corresponding
xxf:hint.appearanceattributes on the first
<xf:model>element) allow setting a default for the labels and hint appearances for the entire form.
The default values is
Supported values for
full: labels show inline above the control (the default)
full minimal: labels show as an HTML placeholder within the field when the field is empty
Supported values for
full: hints show inline below the control (the default)
full minimal: hints show as an HTML placeholder within the field when the field is empty
tooltip: hints show as tooltips upon mouseover
tooltip minimal: hints show as an HTML placeholder within the field when the field is empty
When the global property includes
minimal, it is possible to override the appearance on the control with
If you add the attribute
<xf:textarea>, then the text area will be rendered as an HTML editor:
Rich text editor in Orbeon Forms
When using the attribute
mediatype="text/html", the HTML area will clean-up the HTML typed or pasted in the editor. This is done for two reasons:
- Avoiding a "tag soup" – The HTML received from the browser can be grossly invalid, and contain foreign elements, in particular when pasting text copied from another application (e.g. Microsoft Word) into the editor. If kept as-is, the "HTML" you capture this way is then harder to process.
The cleanup is performed in two stages:
- 1.The HTML goes through TagSoup and converted into a well-formed XML fragment.
- 2.The XML fragment goes through an XSLT transformation, which removes all the
<script>and their content, and only keeps well-known elements in the HTML (such as
<a>...). This is done in
clean-html.xsl, which is bundled in
orbeon-core.jar(prior to Orbeon Forms 2016.3, in
orbeon-resources-private.jar). Should you want to change the way HTML is cleaned, you can override this file by placing your copy under the same path in your resources (typically
HTML Editor in incremental mode – When the HTML editor is in incremental mode, XForms code can't change the value shown by the editor as long as the editor has the focus.