Set value for the text field based on the input in another text field

hi,
i have written an custom script doctype name = “Test” and field name =“test_name”

frappe.ui.form.on(‘Test’,“test_name”,function(frm) {
console.log(cur_frm.doc.test_name);
if(cur_frm.doc.test_name == “Wet Test”){
cur_frm.set_value(“standards_detail”,“STD:ISO”);
cur_frm.dirty();
}
});

i need to set “STD:ISO” to standards_detail but its not getting reflected in UI can any one help me out???
thanks

set

frappe.ui.form.on('Test', {
	test_name: function(frm) {
		console.log(cur_frm.doc.test_name);
        if(cur_frm.doc.test_name == “Wet Test”){
            cur_frm.set_value(“standards_detail”,“STD:ISO”);
            cur_frm.dirty();
        }
	}
});

Or Check your input value
Wet Test Not equal we testing

sorry i tried “Wet Test” while taking snap i typed as wet testing

Hi @vasprog
you can use this

frappe.ui.form.on("Test","test_name", function(frm){
if(cur_frm.doc.test_name === "Wet testing"){
cur_frm.doc.standards_detail = "STD:ISO";
cur_frm.refresh_field('standards_detail');
}
});
3 Likes

thank you it works for me…

Please mark it as an answer so the thread can be marked