0
votes

This is a problem with Drupal 6, specifically in regard to the Webform module.

I'm having problems using the values of my $form_state after I've submitted the form. I can print_r the array of $form_state, but if I try to print or print_r anything further within the array, nothing comes up.

This code snippet shows how I've applied the function to the form...

function custom_form_alter(&$form, &$form_state, $form_id) {

  if ($form_id == 'webform_client_form_237') {
    $first = array_shift($form['#submit']);
    array_unshift($form['#submit'], $first, 'custom_fsfunction');
  }
}

And then this will output the array...

function custom_fsfunction(&$form, &$form_state){

  print_r($form_state);

}

However anything further within will not output anything...

function custom_fsfunction(&$form, &$form_state){

  print_r($form_state['values']);

}

You can see where my problem is. If I can't target anything further in the array then I can't use the forms submitted values.

Any ideas?

1

1 Answers

0
votes

Upon discussion with a senior, it appears that whilst printing the main array variable returned it's contents, printing elements within it did not prompt the values to be returned. For whatever reason that this happened, if you were to print the array variable and then print internal elements in the same function, you'll see the internal values printed along with the array variable.

This being noted, the internal values would be available for custom functions.