how to space out between words on g_form.showFieldMsg

Kifrez
Kilo Guru

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');

find_real_file.png

1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron
Tera Patron

@Freddy 

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

find_real_file.png

2) with 2 spaces

find_real_file.png

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

View solution in original post

6 REPLIES 6

Harish KM
Kilo Patron
Kilo Patron

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');

Regards
Harish

Ankur Bawiskar
Tera Patron
Tera Patron

@Freddy 

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

find_real_file.png

2) with 2 spaces

find_real_file.png

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader