- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-12-2022 10:59 PM
Hi ,
Could someone please help me with g_form.showFieldMsg?
As per script below, I have put some spaces in between however on the form, it shows with only 1 space in between words. How I can ensure that HH is directly below Hours box and mm is directly below minutes box and so on.
The script is
g_form.showFieldMsg('time_worked',' Time format is hh mm ss','info');
Solved! Go to Solution.
- Labels:
-
User Experience and Design
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-12-2022 11:45 PM
Hi,
html tags are not supported in field messages
try this once; it worked well for me
to give one space you can use this \u00a0; to give multiple spaces you can repeat that \u00a0
g_form.showFieldMsg('time_worked',' Time format is\u00a0hh\u00a0mm\u00a0ss','info');
Output: I tried with some other field on my form and it worked well
1) with 1 space
2) with 2 spaces
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
‎07-12-2022 11:19 PM
Hi Unfortunately spaces , break tags wont support in FieldMsg hence you can have a 3 different field messages for the same like below or use Rich text label to display the information if it is a catalog form
g_form.showFieldMsg('time_worked',' Time format is hh ','info');
g_form.showFieldMsg('time_worked',' Time format is mm','info');
g_form.showFieldMsg('time_worked',' Time format is ss','info');
Harish
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-12-2022 11:45 PM
Hi,
html tags are not supported in field messages
try this once; it worked well for me
to give one space you can use this \u00a0; to give multiple spaces you can repeat that \u00a0
g_form.showFieldMsg('time_worked',' Time format is\u00a0hh\u00a0mm\u00a0ss','info');
Output: I tried with some other field on my form and it worked well
1) with 1 space
2) with 2 spaces
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader