The CreatorCon Call for Content is officially open! Get started here.

How add colour to button

APV Babu
Tera Contributor

Hi Every one!!!!

 

I created one new button "plan document team request" in incident form I want to add 'blue' color for the button 

I am trying with this code but I couldn't

 

 

 

 

 

 

 

function onLoad() {
changeButtonColor('plan_document_team_request', '#0000FF');
}

function changeButtonColor(buttonID, backgroundColor) {
try {
//Find the button(s) by ID and change the background color
$$('button[id=' + buttonID + ']').each(function(elmt) {
elmt.style.backgroundColor = backgroundColor;
elmt.style.color = '#ffffff'; //make the button text white
});
}catch(e){}
}

1 ACCEPTED SOLUTION

@APV Babu Add one more css for bottom button just like

 

#plan_document_team_request_bottom {

//Add the color as you added for up button

}

 

Please mark as correct answer if this solves your issue.

Please mark the answer as correct or helpful based on impact
ServiceNow Community Rising Star, Class of 2023

View solution in original post

10 REPLIES 10

reshmapatil
Tera Guru

APV Babu
Tera Contributor

I changed color code but its not working

jaheerhattiwale
Mega Sage

@APV Babu You are trying to do it with DOM manipulation. That's not recommended  by ServiceNow. You can use the class defined in the UI Action itself.

 

jaheerhattiwale_0-1671197750561.png

 

If at all you want other colors then please try below link

https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB1004974

 

Please mark as correct answer if this solves your issue.

Please mark the answer as correct or helpful based on impact
ServiceNow Community Rising Star, Class of 2023

@jaheerhattiwale  Thanks for reply🤝

 I am getting color only on the top button, but not in the bottom