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 { drupal_set_message("HOLIDAY"); } }
what should I do to unset my field?