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

Charles Louis1
Giga Expert

Hi 

you can try this 


    g_form.showFieldMsg('time_worked',"Time format is");
    g_form.showFieldMsg('time_worked', "hh");
    g_form.showFieldMsg('time_worked', "mm");
    g_form.showFieldMsg('time_worked', " ss");

 

Please Mark this as correct if its helpful.

hi Mervin, unfortunately, the result is same. thanks for trying.

Hi the above code show's something like this for me as you can't add newline(\n) or <br> they are not supported so only way is to add 4 different showfieldMsg for the same field. find_real_file.png

hmm odd it doesn't work for me, anyway what we want is this (red text)

find_real_file.png