Change field colour using custom script

Hi ,
How to change field colour using custom script ?

@Shashank_Mishra You can’t change the colour of a field. You can make it mandatory (red). Use this.frm.toggle_reqd(field_name, condition);

@neilLasrado what is the way to make child table field mandatory on a specific condition but it should make mandatory the field in all the rows it should only be applicable on the row where the condition matches like.

if (frm.doc.fieldname==“Value”)

@ruchin78 [child_table_name] on_form_rendered event is fired when you open a row in the child table. Try using togle_reqd inside that function. I am not sure if it would work out, but worth trying.

Hi neilLasrado ,
Thanks for the reply .
I want to highlight the fields if a user changes the value of the field , so that admin can check what have been there any other way to do this apart from making field required ?

@Shashank_Mishra there isn’t a way to do that at the moment.

@Shashank_Mishra you can directly change the CSS properties (there is not API for this)