Hi all. I am trying to make a form where some external content is loaded into a div element through AHAH when a button is clicked.
The following screenshot of firebug shows that I actually received a response:
http://clip2net.com/clip/m6360/1211907941-clip-28kb.png
The following screenshot shows the error message I receive when clicking on the button:
http://clip2net.com/clip/m6360/1211908061-clip-9kb.png
(It says
An error occurred.
/drupal/sites/all/modules/poster/poster.generate.php
(no information available).
)
Below is the snippet of code for the form I generated.
$form['preview'] = array(
'#type' => 'button',
'#value' => t('Preview'),
'#ahah' => array(
'path' => drupal_get_path('module', 'poster') . '/poster.generate.php',
'wrapper' => 'poster-preview',
'method' => 'replace',
'effect' => 'fade'
)
);
$form['poster-preview'] = array(
'#type' => 'markup',
'#value' => '<div id="poster-preview"></div>'
);
return $form;
What format does AHAH expect when it gets a response? JSON? HTML? Text? Any format?
Does anyone know why this isn't working? Thanks ahead of time!
Comments
Have same problem.
Did anybody explain your this error?
Solution
I ran into this same situation - here is my (untested) solution: