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->sid ? $submission->sid : FALSE;
if($sid){
$currentSid = array('mymodule' => array('sid' => $sid));
$node->content['#attached']['js'][] = array(
'data' => $currentSid,
'type' => 'setting',
);
}
}