Is it possible to make Tab Break Hidden using JavaScript?

Hello,

I have been trying to make Tab Break Hide/Unhide on condition using JavaScript. However, my code is working for other field type, but not for Tab Break. Below is my code:

         if (frm.doc.temp_id=="" || frm.doc.temp_id==null){
                        cur_frm.set_df_property('compliance_a_header', 'hidden',true);
                        cur_frm.set_df_property("tb_compliance_a","hidden",true);
                } else {
                        cur_frm.set_df_property('compliance_a_header', 'hidden',false);
                        cur_frm.set_df_property("tb_compliance_a","hidden",false);
                }

working: cur_frm.set_df_property('compliance_a_header', 'hidden',true);
not working: cur_frm.set_df_property("tb_compliance_a","hidden",true);

Regards
Mijan

@mijan1373 what if you trigger refresh fields ?

eg:

   if (frm.doc.temp_id=="" || frm.doc.temp_id==null){
            cur_frm.set_df_property('compliance_a_header', 'hidden',true);
            cur_frm.set_df_property("tb_compliance_a","hidden",true);
            cur_frm.refresh_fields();
    } else {
            cur_frm.set_df_property('compliance_a_header', 'hidden',false);
            cur_frm.set_df_property("tb_compliance_a","hidden",false);
            cur_frm.refresh_fields();
    }

In that case cur_frm.set_df_property('compliance_a_header', 'hidden',false); always firing i.e. compliance_a_header field is always remain visible. But, if I use 0 and 1 instead of false and true respectively, this works fine.

But, cur_frm.set_df_property("tb_compliance_a","hidden",true); is not giving result in either case.

Regards
Mijan