drupal7 hook_validate

原文:function hook_validate

function hook_validate($node, $form, &$form_state) {
  if (isset($node->end) && isset($node->start)) {
    if ($node->start > $node->end) {
      form_set_error('time', t('An event may not end before it starts.'));
    }
  }
}

 



posted @ 2017-10-11 10:13  jiafeng  阅读(201)  评论(0编辑  收藏  举报