All pastes #306115 Raw Copy code Copy link Edit

Stuff

public text v1 · immutable
#306115 ·published 2007-01-05 02:11 UTC
rendered paste body
<?php
function dojo_form_alter($form_id, &$form) {
  if ($form_id == 'page_node_form') {
    $form['#theme'] = 'dojo';
    $form['#validate']['dojo_validate'] = array();
  }
}

function theme_dojo($form) {
  $output = '<h1>I added this to the top of the form</h1>';
  //unset($form['title']);
  $output .= drupal_render($form);
  return $output;
}

function dojo_validate($form_id, $form_values, $form) {
  if ($form_values['title'] == 'Foo') {
    form_set_error('title', t('Foo is not allowed'));
  }
}