Bumped by Community user
    Bumped by Community user
4 added 3 characters in body
source | link

I want to hide a field on a node when its value is set to zero using a content type. hereHere 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 iI get the value that iI 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?

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?

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?

3 cleaned the code, fixed typo, added tag
source | link

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:

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 shoul ishould I do to unset my field?

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 shoul i do to unset my field?

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?

2 deleted 7 characters in body
source | link
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]>field_pd_public_holiday[0]); // here iam wrong and confused 

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

what shoul i do to unset my field?

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?

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 shoul i do to unset my field?

1
source | link