[support] hook_form_alter() and custom cck forms

Mutuku Ndeti jnmutuku at gmail.com
Tue May 11 18:49:45 UTC 2010


I have a custom cck form in which I want to alter some of he fields on the
form. When I try the code on the forms that come with drupal e.g
user_profile_form, my code(at least return print_r($form);) works.

When I "view" my html source for  my custom cck form, I get the souce below
for the form id is "node-form" as you can see
<form action="/node/add/my-custom-form" accept-charset="UTF-8" method="post"
id="node-form" enctype="multipart/form-data">

my hook_form_alter code is as below


function fielddisable_form_alter(&$form, $form_state, $form_id) {

    switch ($form_id) {


        case 'node_form':


            return print_r($form);

        break;


    }
  }

What Am I doing wrong?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.drupal.org/pipermail/support/attachments/20100511/b3745ab2/attachment.html 


More information about the support mailing list