- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-12-2016 05:30 AM
Hi,
I am struggling here to change the UI action button color to green when the button name is Approve and Red for button with name Reject.
Change the Color of Form Buttons - ServiceNow Guru
I also looked at the above link but to no avail.
You quickest response on this is appreciated.
Regards,
Narmi
Solved! Go to Solution.
- 14,601 Views
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-14-2016 06:14 AM
You should be all set now. I went in and added a console.log statement inside of your "catch". This gave me the information that jquery was inaccessible, which in a scoped app it is not by default. (Scoped Applications and Client Scripts: A Primer )
I created a system property for you "x_69534_superduper.glide.script.block.client.globals" which enables this. (ServiceNow )
I disabled all of the alerts and the timeout that were set through testing and everything seems to work now.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-14-2019 02:46 AM
This post might be a bit old, but the client script below might help you when defining a colors for your buttons:
function onLoad(){
buttonColors('reject', 'red', 'white');
buttonColors('approve', 'green', 'white');
}
function buttonColors(buttonId, backgroundColor, color){
try{
$j("[id=" + buttonId + "]").css("background-color", backgroundColor).css("color", color);
} catch(e) {console.log(e);}
}