I'm trying to make a ahah form. the problem is the ahah is ignored. when i check the classes on the submit button, it doesn't have the 'ahah-processed' class. The really interesting thing is that ahah is working perfectly on my site, and even on a nearly identical form I created. this is how i'm creating the ahah submit button:
$form['ri_email_submit'] = array(
'#type' => 'submit',
'#value' => t('Submit'),
'#weight' => 1,
'#submit' => array('ri_email_form_submit'),//none JS version
'#ahah' => array(
'event' => 'click',
'path' => 'ri_email/ajax',
'wrapper' => 'email-friend-wrap',
'method' => 'replace',
'effect' => 'fade',
'progress' => array(
'type' => 'bar',
'message' => t('Loading...')
)
)
);
I checked the menu path, it's correct.
UPDATE: this is the menu callback:
function ri_email_ajax() {
return drupal_json(array('status' => TRUE, 'data' => '<p><strong>Your email has been sent.</strong><p>')); }
by the way, i discovered that it didn't work when i invoked drupal_get_form() from page.tpl.php, but it does work from node.tpl.php
there is something missing with the javascript that is supposed to handle the ahah