How to change background color for info message

aarya1
Giga Contributor

Hi

How do i change the background color for info message (Normally we get info message in blue color but in my case i need to get it in different color).

Could you please suggest for my approach

Regards

Aarya

1 ACCEPTED SOLUTION

Saurav11
Kilo Patron

Hello Aarya,

 

There are additional message types that you can use:

g_form.addWarningMessage = yellow

g_form.addErrorMessage = red

g_form.addInfoMessage = blue

you can change the font color using the following script:

var message1 = 'TEST';
var message2 = message1.fontcolor("red");
g_form.addInfoMessage(message2);

You can also use text background high-lighting such as:

var message = '<b><p style="color:black;background-color:orange;">';
message+='TEST';
g_form.addInfoMessage(message);
	

or

var message = '<div style="background-color:blue;color:white">Assignment group changed.<br/>';
g_form.addInfoMessage(message);
	

 

Hope this helps. Please mark the answer as correct/helpful based on impact.

 

View solution in original post

8 REPLIES 8

Hey man , thank you for keeping it straight to the point with the answer. 
Super helpful thank you will look into annotations or sticking with the message.

Not applicable

Hi aarya,

Create a new annotation and place it below the field you would like to. 

find_real_file.png

in HTML, you can add css for color change.

 

Also, refer to :https://community.servicenow.com/community?id=community_question&sys_id=f4c50721db1cdbc01dcaf3231f9619e6

 

Please mark my answer as Correct & Helpful, if applicable.

Thanks

Sandeep

Saurav11
Kilo Patron

Hello Aarya,

 

There are additional message types that you can use:

g_form.addWarningMessage = yellow

g_form.addErrorMessage = red

g_form.addInfoMessage = blue

you can change the font color using the following script:

var message1 = 'TEST';
var message2 = message1.fontcolor("red");
g_form.addInfoMessage(message2);

You can also use text background high-lighting such as:

var message = '<b><p style="color:black;background-color:orange;">';
message+='TEST';
g_form.addInfoMessage(message);
	

or

var message = '<div style="background-color:blue;color:white">Assignment group changed.<br/>';
g_form.addInfoMessage(message);
	

 

Hope this helps. Please mark the answer as correct/helpful based on impact.