Friday, 5 August 2016

ERPNext Change Field Text Color and Background Color


Today I received one email about how to change Text Color in ERP.
Frappe Framework uses jQuery, so if you know jQuery, you can add your custom css using jQuery selectors.
I am giving solution, it will helpful to Highlight fields based on condition. (e.g. Amount should be red is amount is greater than equal to 10)

In below image I have field "Amount"

Code to select Amount field in jquery


Code to get value in amount field


Code to add Text Color Red


Code to add css to change background color


Note: You can write above jquery code in onload function of Frappe Custom Script to execute your code before loading of Form.
frappe.ui.form.on("Doctype Name", "onload", function(frm,cdt,cdn) {
//your code

You can email me if you need any help. My email id is

Sambhaji Kolate

1 comment:

  1. I am struggling to know how to change the background color for all the site.

    I can’t find where to use: