How to ajaxify webform submit in Drupal 7? I have tried to alter the webform rendering using hook_form_alter() and hook_node_view() in a custom module so I could add '#ajax' somewhere.

Has anybody already had some experience working with webform and ajax on D6 or D7 ?
I guess the logic would be the same for D6 and D7 then just the implementation changes.
The Ajax Module works for me in Drupal 6. 

For Drupal 7:

function mymodule_form_alter(&amp;$form, &amp;$form_state, $form_id) {
      // see if webform_client_form_ is in the form_id
      if(strstr($form_id, 'webform_client_form_')) {
        // get the nid so we can use it in the wrapper value
        $nid = $form['#node']-&gt;nid;
        // add the ajax properties to the submit button
        $form['actions']['submit']['#ajax'] = array(
          'callback' =&gt; 'mymodule_webform_js_submit',
          'wrapper' =&gt; 'webform-client-form-' . $nid,
          'method' =&gt; 'replace',
          'effect' =&gt; 'fade',
        );
      }
    }

function mymodule_webform_js_submit($form, $form_state) {
      // define the $sid variable (submission id from webform)
      $sid = $form_state['values']['details']['sid'];
      // if we have a sid then we know the form was properly submitted, otherwise, we'll just return the existing $form array
      if ($sid) {
        // first we have to load up the webform node object
        $node = node_load($form_state['values']['details']['nid']);
        // create an array up with the confirmation message, retreived from the webform node
        $confirmation = array(
          '#type' =&gt; 'markup',
          '#markup' =&gt; check_markup($node-&gt;webform['confirmation'], $node-&gt;webform['confirmation_format'], '', TRUE),
        );
        // return the confirmation message
        return $confirmation;
      }
      else {
        // return the form
        return $form;
      }
    }