We’re rewarding the question askers & reputations are being recalculated! Read more.
1 of 4

how to hide a field when its value is set to zero

I want to hide a field on a node when its value is set to zero using a content type. here is what i had done so far to achieve my goal:
function pay_nodeapi(&$node, $op, $a3 = NULL, $a4 = NULL)
{
    global $user;

if($node->type=='salary_info' && $op=='presave')
    {


      $public_holiday = $node->field_sstru_public_holiday[0]['value'];// here i get the value that i set to 0(No) or 1(YES) using a select list. 

      if($public_holiday == 0)
      { 

         $nid = node_load(207919); // load node where i want to unset this field

    unset($nid->field_pd_public_holiday[0][value]); // here iam wrong and confused 

    }
     else
     {
      drupal_set_message("HOLIDAY");
     }
    }

what shoul i do to unset my field?