Podcast #128: We chat with Kent C Dodds about why he loves React and discuss what life was like in the dark days before Git. Listen now.
4 of 5 added 3 characters in body

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]); // here iam wrong and confused 
    else {

what should I do to unset my field?