3

I've written some modal box functionality that loads HTML into the DOM as snippets. This includes AHAH-enabled forms.

I've got as far as pulling out the AHAH settings, and can re-initialize:

jQuery.extend( Drupal.settings, response.setting );

I can also re-initialize:

Drupal.attachBehaviors( container );

I've even ensured that ahah.js is always loaded into the main page.

All this doesn't seem to be enough to get it working. Does anyone know what else I need to do?

Tim Whitlock
  • 1,111
  • 9
  • 17
  • also ensuring that jquery.form.js is loaded. I can get as far as getting the AHAH response, but the callback doesn't fire to load into the wrapper – Tim Whitlock Apr 27 '10 at 19:30
  • I think I've sorted it. The ahah.js ajax call has no error callback. it was failing silently, but the fault was in my response json. – Tim Whitlock Apr 27 '10 at 19:56
  • 1
    You should post your own solution as an answer and eventually accept it. – Henrik Opel May 17 '10 at 21:43

1 Answers1

2

The steps in my initial question are actually fine. This is all you need to do to get AHAH kick-started into a custom bit of JS. As I said in my comment the AHAH JavaScript has no error callback, so put some breakpoints in ahah.js if things don't seem to be working as expected.

Tim Whitlock
  • 1,111
  • 9
  • 17