Change Allow on Submit using custom script

hello i wanna ask
is that possible to change field become allow on submit using custom script with some condition if that field dont have any value?

example :
i create field A on Journal Entry, if i didnt put any value on field A and when i submit my Journal Entry, field A will possible for us to change/put the value
but if i put some value on field A and when i submit my Journal Entry, i cannot edit the field A

@Rico_Nova
of course it is possible. You have to add custom script for that.
Add your field as Allow on Submit and write custom script for your Doctype

e.g.

cur_frm.cscript.on_submit = function(doc) {
	if(doc.field_name) {
		cur_frm.set_df_property("field_name", "read_only", 1);  
	}
}
1 Like

thank you guys :smiley: