Checkbox Checked

How to make Checkbox Checked If Some Condition is True in Client Script

1 Like

frm.set_value(fieldname, 1)

Below is an example where i automatically check update stock given a condition

    if (frm.doc.is_return === 0){
        frm.set_value('update_stock', 1);
        frm.set_df_property('update_stock', 'read_only', 1);        
    } else if (frm.doc.is_return === 1){
        frm.set_df_property('update_stock', 'read_only', 0);   
    }