how to write field message in new line?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-02-2021 01:52 AM
I want field message to appear like below in a single field message not like double messages.
I have tried \n, <br>,<BR> but no use. Please suggest.
- Labels:
-
Service Catalog
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-02-2021 03:24 AM
Hi,
can you show alert for this
var message_text = 'line1' + '*' + 'line2' + '*' + 'examples :' + '*' + 'line3' + '*' + 'line4';
var arr = message_text.split('*');
var join = arr.join('\n');
alert(join);
g_form.showFieldMsg('variable', join, 'info');
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-02-2021 03:30 AM
'\n' will work properly in alert & in g_form.addInfoMessage() but not in field messges.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-02-2021 03:36 AM
Hi,
I would suggest to go with the approach I mentioned about every message on new line
for making it work on portal DOM manipulation etc would be required which is not recommended
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader