criscom
11/15/2015 - 7:44 PM

#module implementation of hook_form_alter

#module implementation of hook_form_alter

<?php

/*
 * Implementatiion of hook_form_alter()
 */

 function custom_example_form_alter(&$form, &$form_state, $form_id) {
    // dsm($form_id);
    // target a single form
  /* print the variables if needed to allow for 
  individual field theming or breaking them up. */
    if($form_id == "article_node_form") {
        dsm($form);
        $form ['title']['#title'] = t('Ole, ole ole ole!');
        $form['title']['#required'] = FALSE;
    }
// adjust input fields on the user login form
// below changes are overwritten by changes done via template.php
    if($form_id == 'user_login' || $form_id == 'user_login_block') {
        $form['name']['#title'] = t('Blödsinn');
  }    
 }