Good day,
I have written a function so that if one check bok is selected then all other fields are made 0 but i have realized that frm.set_value(field_name, value) doesn’t take a available but the doc field name as it is, can someone help me as i don’t want to write many ifs
let switch_month_periods = function(frm, selected){
const periods = ["1_month", "6_month", "12_month", "24_month", "48_month"];
for (let i = 0; i < periods.length; i++) {
if(selected != "periods[i]"){
frm.set_value(periods[i], 0)
}else{
frm.set_value(periods[i], 1)
}
}
}