Search code examples
phpajaxdrupaldrupal-6

Embedding an AHAH form element into a theme_table-generated table (Drupal)


I am trying to include a Drupal form element in a table I am generating with theme_table/theme('table',..). Specifically, I am trying to include a submit button with an AHAH attached.

Currently, I am just including as one cell in each row a call to drupal_render to render my dynamically generated AHAH element. The button renders fine, but without the AHAH attached.

So, my question is: is there a way to attach an AHAH to something that is just drupal_rendered?

If not, how else can I attach an AJAX/AHAH call to an element in a theme_table-generated table? I need to allow users to perform certain actions on rows of data in the table but need the page to not refresh.

TIA,
Benjy


Solution

  • I believe AHAH only works with drupal_get_form(). You'd have to write the AJAX yourself ( handbook page).

    Maybe you could save the return value from drupal_get_form() in a variable and pass it to the theme function?