$errors = drupal_get_messages('error'); // Note: To set a customized error message for a core Drupal field, the first parameter // should not be the same value as an identifier for that default Drupal field. i.e. first // parameter should not be "title", "body_filter", "field_category" because those are // reserved by Drupal. if (strlen(trim($node->title)) <1){ form_set_error('title_field','Information Tab: Title is required.'); } if ($node->field_category['tids'] == 0 ) { form_set_error('field_category','Information Tab: Category is required.'); } if (strlen(trim($node->field_design_problem['0']['value']))<1){ form_set_error('field_design_problem','Problem Tab: "Design Problem" is required..'); } if (strlen(trim($node->field_solution[0]['value']))<1){ form_set_error('field_solution','Solution Tab: "Solution Description" is required.'); } if (strlen(trim($node->field_how[0]['value']))<1){ form_set_error('field_how','Solution Tab: "How" is required.'); } if (strlen(trim($node->field_why[0]['value']))<1){ form_set_error('field_why','Solution Tab: "Why" is required.'); } // Check for Solution image attribution and image. Both values should come in pairs. // If at least one of the pair is missing, notify the user. if ( (count($node->field_solution_image) < 1)&& (strlen(trim($node->field_solution_image_attributio['0']['value'])) < 1) ) { form_set_error('field_image_upload_upload','Solution Tab: Solution image is required.'); form_set_error('field_solution_image_attributio','Solution Tab: Solution image source is required.'); } else if (count($node->field_solution_image) < 1) { form_set_error('field_solution_image','Solution Tab: Solution image is required.'); } else if (strlen(trim($node->field_solution_image_attributio['0']['value'])) < 1) { form_set_error('field_solution_image_attributio','Solution Tab: Solution image source is required.'); }