Rich text field
A WYSIWYG editor for bold/italic/lists/links, stored as HTML in a SharePoint Note column with RichText enabled.
The Rich text field is a WYSIWYG editor, headings, bold, italic,
underline, strikethrough, bullet & numbered lists, blockquotes, inline code,
text alignment, hyperlinks and tables. The value is stored as sanitised HTML
in a SharePoint Note column configured with Enhanced rich text enabled, and the
same HTML is rendered (not shown as raw markup) on the display form.
Common properties
| Property | Description |
|---|---|
labelstring | Visible label. |
descriptionstring | Helper text. |
requiredboolean default: false | Marks the field required. |
readOnlyboolean default: false | Disables editing, the rendered HTML is still shown. |
Type-specific properties
| Property | Description |
|---|---|
richTextMode'FullHtml' | 'Compatible' default: 'FullHtml' | SharePoint RichTextMode. FullHtml enables the full editor (headings, lists, links, alignment, tables). Compatible restricts output to inline formatting only (bold/italic/underline/strike/links) for SP-classic-safe storage. |
toolbar'minimal' | 'standard' | 'full' default: 'full' | Toolbar preset. minimal = bold/italic/underline/strike. standard = adds lists + links. full = adds headings, blockquote, code, alignment and tables. Compatible mode forces this down to minimal. |
maxLengthnumber | Optional limit on the plain-text (HTML-stripped) length. A live counter appears as the field nears the limit. |
JavaScript recipes
Read the HTML value
const html = f365.field('Notes').value as string;
Set the value programmatically
f365.field('Notes').value = '<p>Reviewed and <strong>approved</strong>.</p>';
Lock the editor for a given status
f365.events.onChange((e) => {
if (e.fieldKey !== 'Status') return;
f365.field('Notes').readOnly = e.newValue === 'Closed';
});
Warn when the field is left empty
f365.events.onBeforeSave(() => {
const html = String(f365.field('Notes').value ?? '');
const text = html.replace(/<[^>]*>/g, '').trim();
if (!text) {
f365.ui.showToast('Please add some notes before saving.', 'error');
return false;
}
return true;
});
Related
Related articles
- Textarea field
Multi-line free text, for paragraphs, descriptions, notes, and anywhere a single-line text field would overflow.
- Text field
Single-line text input, the foundation field for names, codes, and short free-text.