I wrote a custom method to do some set of operations when a webform is submitted and that is working fine. However I need to access some fields values that has been submitted in the Webform.
The fields in the Webform are: 'phone' , 'emailid'. I need to access these variables in the method custom_example_some_function
. I tried playing around with some arrays, but that didn't worked out.
function custom_example_form_alter(&$form, &$form_state, $form_id) {
if ($form_id == 'webform_client_form_22') {
$form['#submit'][] = 'custom_example_some_function';
}
}
function custom_example_some_function($form, &$form_state) {
// Do something
// echo $phoneNumberFromForm;
// echo $emailidFromForm;
}