Change color of custom button

Hi,
I want to change custom button color.

frm.add_custom_button(__(“Do Something”), function() {
something here//
});

1 Like

Please Help!

I think you can use jquery to dynamically add css to your button.

1 Like

Hi @littlehera thank you for your reply.
I have applied jquery but giving error.

frappe.ui.form.on(“doctype”, { refresh: function(frm)
{ set_css(frm); } });
var set_css = function (frm) { document.querySelectorAll(“[data-fieldname=‘button_name’]”)[1].style.backgroundColor =“#87CEFA”; }

Thank You

@hari.kishor I hope it helps frappe-guide/3. botones.md at master · monroy95/frappe-guide · GitHub

3 Likes

Hi, @monroy95 i am not unable to apply for custom button.

frm.add_custom_button(“Send SMS”, function(click){
/// i am applying css for Send SMS
});

Thank You

that’s worked!
Thank You

2 Likes