Active
Project:
Webform Block
Version:
6.x-1.1
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
28 Aug 2009 at 09:08 UTC
Updated:
14 Feb 2010 at 21:10 UTC
I will like to display the form result(submit the form to itself, wrapped in a hidden div) within the block itself(as well as the same page), instead of it redirecting to something like node/%webform/done?sid=?.
I tried overriding the hook_form_alter or hook_form_FORM_ID_alter, but it seems these functions cannot be overriden in the theme level, unless it is implemented by another module.
In my implementation anyway, I tried using the AHAH form type, so that the path attribute calls the drupal_get_destination() function, and the wrapper attribute updates a div.
function custommodule_webform_client_form_alter(&$form, &$form_state) {
if($form_id == 'webform_client_form') {
$form['wrapper'] = array(
'#prefix' => '<div id=feedback-result',
'#suffux' => '</div>',
);
$form['wrapper'] += _webform_confirmation($node);
$form['#submit'] = array(
'ahah' => array(
'path' => drupal_get_destination(),
'wrapper' => 'feedback-result',
'method' => 'replace',
'effect' => 'fade',
'event' => 'click'
),
);
}
}
Thanks. Will be checking this post from time to time.
Comments
Comment #1
buddaNot critical. Accepting patches, but no time to work on this myself.