Change filed background color

Hi @Cross_X,

Please check the code.

It’s a example

frappe.ui.form.on('Item', {
    refresh : function(frm){
        document.querySelectorAll("[data-fieldname='item_code']")[1].style.backgroundColor = 'red';
        document.querySelectorAll("[data-fieldname='item_code']")[1].style.color = 'white';
        document.querySelectorAll("[data-fieldname='item_code']")[1].style.fontWeight = 'bold';
    }
});

Output:

I hope this helps.

Thank You!

4 Likes