By pre911mindset on
I am using Drupal 6.4. Not sure if same issue applies to Drupal 7.x
When I add the following checkbox ahah element, it works fine if I add it in the form initially.
If I add the element to the form as part of an ahah callback, the checkbox is added but the ahah event does not occur. I have applied the patch defined here:
but it does not seem to fix the problem. Does this sound like a bug in ahah 6.x core?
$form['test']['check'] = array (
'#prefix' => '<p>',
'#type' => 'checkbox',
'#name' => 'Display_Debugging',
'#title' => 'Display Debug Fields',
'#default_value' => FALSE,
'#ahah' => array(
'path' => TEST_PATH,
'event' => 'click',
'wrapper' => TEST_WRAPPER,
'progress' => array('type' => 'bar', 'message' => t('Grinding...')),
),
);
Comments
I've got the same problem
I've got the same problem with Drupal 6.16.
If I add a checkbox manually and "statically" with
AHAH handlers are added to the checkbox. But if this checkbox itself is only shown because of another AHAH action or rather because of $form_state['values'], AHAH handlers aren't added to this checkbox altough the code is nearly the same as the one above. (Only called $form['vocabularies_references']['lalala']['testbox'] instead of $form['vocabularies_references']['testbox']...)
Anyone got an idea how to solve this issue?
Regards,
Matt
Following code snippet within
Following code snippet within the AHAH-callback function solved the problem:
Taken from http://civicactions.com/blog/2009/jun/20/ajax_ifying_drupal_node_forms