How to transfer webform submission ID to client side I need to transfer the submission ID to the client side after a webform is submitted. The problem is that after submission the Confirmation page is showed. And how can I attach the current sid to a page? I know how to do it on a node (se below) with Drupal behaviors on a client side JS-script.

Anyone? Or maybe the sid can be transfered to the client side another way?

function mymodule_webform_submission_insert($node, $submission) {
 // $node will give you the node id of your webform
 // $submission will give you the id of your data which you inserted in web form
 $sid = $submission-&gt;sid ? $submission-&gt;sid : FALSE;
 if($sid){
   $currentSid = array('mymodule' =&gt; array('sid' =&gt; $sid));
   $node-&gt;content['#attached']['js'][] = array(
     'data' =&gt; $currentSid,
     'type' =&gt; 'setting',
   );
 }
}
You could start by putting the submission id into $_SESSION and add it to Drupal's js settings

drupal_add_js(array('mymodule' =&gt; array('webform_id' =&gt; $_SESSION['webform_id'])), 'setting');


Then access it on the client side

webform_id = Drupal.settings.mymodule.webform_id