Hi,
I got some trouble writing a module that make me modify some form elements generated bu CCK. In other words i wish i have the possibility to add #ahah property in my field, a nodereference select list, to change options in other nodereference select (classic state->country->city problem). The issue is that while i am able to change and add field property in hook_form_alter (i.e. i added suffix, prefix, i changed titles and default values), i'm not able to get the #ahah property works. I know for sure that the callback is right because i have tested it in a complete brand new custom module (i recreated a new form, not modifying a cck).
Someone has some advices or some references to best practice?

Thanx

Comments

kkinfy’s picture

Hi, May be this example helps you

  $form['choice_wrapper']['poll_more'] = array(
    '#type' => 'submit',
    '#value' => t('More choices'),
    '#description' => t("If the amount of boxes above isn't enough, click here to add more choices."),
    '#weight' => 1,
    '#submit' => array('poll_more_choices_submit'), // If no javascript action.
    '#ahah' => array(
      'path' => 'poll/js',
      'wrapper' => 'poll-choices',
      'method' => 'replace',
      'effect' => 'fade',
    ),
andrea.vivaldi’s picture

thank you very much for the quick reply, but i have followed yet this example... i don't know why but the ahah callback declared in the path isn't called... It's a kind of incompatibility between CCK noderefence and the #ahah property?