Hi,
I’ve coded child table for total calculating percentage of all rows.
i want to changing its color to RED if it gets greater than 100.
please anybody can help me up?
below is my code and SS.
That could maybe work with an html field, but not with a data…
In your customscript, you have to select the corresponding html element like “var field = documemt.getElementById(“id of field”);”
Afterward you could add the css properity to iz with for e.g. “field.style.background-color = “red”;”
if (frm.doc.total_percentages >100) {
frappe.msgprint(“Total Percentage Cannot be Greater Than 100%”);
document.querySelectorAll("[data-fieldname='total_percentages']")[1].style.backgroundColor="red";
}
jquery.min.js:4 [Deprecation] Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user’s experience. For more help, check https://xhr.spec.whatwg.org/.
send @ jquery.min.js:4
libs.min.js?ver=1516030925.0:7295 WebSocket connection to ‘ws://www.erp.com/socket.io/?EIO=3&transport=websocket&sid=57cN3VPNx2F0IeCAACyG’ failed: Error during WebSocket handshake: Invalid status line
n.doOpen @ libs.min.js?ver=1516030925.0:7295