I'm using Webform 6x 3.11 and have passed a nodeID into a hidden field called hidden_key
. I have created a custom module to implement hook_form_alter()
whereby I am trying to add additional data (along with the data that is being submitted) to the submission results.
This additional data is based on some calculations performed on the value in the hidden field, ie: getting some details about the node based on the nodeID. Here's what I currently have:
<?php
function custom_form_proc_form_alter(&$form, &$form_state, $form_id) {
if ($form_id == 'webform_client_form_33') {
$form['#submit'][] = 'custom_form_proc_submit';
}
}
function custom_form_proc_submit($form, &$form_state) {
$node = node_load($form_state['values']['hidden_key']);
$pool_title = $node->title;
$pool_category = $node->field_category[0]['value'];
// ?????
}
?>
Where you see my ?????
is where I am stuck. Along with whatever data gets submitted with the form, I would like to add these 2 custom fields to the submission results so that it looks like:
Fullname: Mr So-and-So
Email Address: [email protected]
Pool Category: $pool_category
Pool Title: $pool_title
Availability: Yes
I would really appreciate your help! Thank you!