How to remove/hide "Bold" option and styling from HTML fields in form?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
I am looking for the best practice / recommended approach to restrict or remove the "Bold" text option and bold styling from HTML fields on a form.
Specifically, I want to address two main requirements:
1. Toolbar Restriction: Prevent users from applying bold formatting by removing/hiding the Bold button (and shortcut) from the TinyMCE toolbar on a specific HTML field (or globally if needed).
2. Style / Content Sanitization: Prevent existing `<b>` or `<strong>` tags (or inline font-weight: bold styles) from rendering or saving as bold text inside the field.
- What is the most seamless way to restrict the toolbar button for a specific field without breaking TinyMCE?
- Is there a built-in ServiceNow configuration or HTML Sanitizer setting to strip/ignore bold tags automatically?
Any examples or best practices would be greatly appreciated!
Thanks in advance for your help!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
You can try with Updating System properties "glide.ui.html.editor.toolbar" as per below mentioned servicenow Documentation .
Refer: Configur ing the TinyMCE toolbar via Dictionary attributes
https://www.servicenow.com/docs/r/platform-administration/tinymce.html
Procedure
- Navigate to All > System Properties > UI Properties.
- Update the Configures the editing toolbar for HTML fields(TinyMCE v6.8.2) (glide.ui.html.editor.toolbar) property to add or remove buttons for the toolbar.Note:Type ButtonsUse a vertical bar ("|") to add a section separator.
Default buttons bold italic underline undo redo | fontfamily fontsize table | forecolor backcolor link unlink | image media code | alignleft aligncenter alignright | bullist numlist fullscreen Available buttons newdocument, bold, italic, underline, strikethrough, justifyleft, justifycenter, justifyright, justifyfull, blocks, fontfamily, fontsize, tablecontrols, cut, copy, paste, pastetext, pasteword, search, replace, bullist, numlist, outdent, indent, blockquote, undo, redo, link, unlink, image, cleanup, code, forecolor, backcolor, removeformat, hr, visualaid, sub, sup, charmap, media, preview, fullscreen, accordion - Select Save.
Regards
Tanushree Maiti
ServiceNow Technical Architect
LinkedIn: https://www.linkedin.com/in/tanushreemaiti
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
on the field dictionary add this attribute and it will disable everything
editor.toolbar=false
Output
💡 If my response helped, please mark it as correct ✅ and close the thread 🔒— this helps future readers find the solution faster! 🙏
Ankur
✨ Certified Technical Architect || ✨ 10x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Thank you for marking my response as helpful.
Don't go with the system property update as it will impact all the HTML fields in instance.
💡 If my response helped, please mark it as correct ✅ and close the thread 🔒— this helps future readers find the solution faster! 🙏
Ankur
✨ Certified Technical Architect || ✨ 10x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Thank you to everyone who reviewed this!
I was able to resolve this issue by adding a custom dictionary attribute to the HTML field to explicitly define the TinyMCE toolbar options and leave out the Bold button.
Solution:
Right-clicked the HTML field label and selected Configure Dictionary.
Added the following under Attributes:
editor.toolbar=blocks | italic underline | numlist bullist | outdent indent | link unlink image table | removeformat
This removed the "Bold" option and other options from the HTML field toolbar. Marking this thread as resolved for anyone else who might need this.