I'm rather new here at the Drupal forum. Started to use the webform module to develop a task selection utility for one of our PHD research members.

In the Webform field 'Confimation message or redirect URL' I entert a URL of a webform that is used as general reaction webform after each task (for messuring Mental Effort).
In this 'Mental Effort" webform I would like to save the referer (the url of the webform (task) before this form). I managed to do this by add a hidden field in the 'Mental effort' webform and put the %server[http_referer] in this field. Seems to work for me.

The seccond is that I would like to put a hidden field in the Task webform that contains the redirect URL for the 'Mental Effort' webform. So this should be filled in in the 'Confimation message or redirect URL' of the 'Mental Effor' webform.

In this way I like to create the possibility to change redirection of the 'Mental Effort' webform from the tasks webforms.

In the 'Confimation message or redirect URL' I think I should enter something like:
internal: %server[query_string('name of the hidden field in the referer webform')]

I think this is not supported but hope I mis the correct information.
Could somebody give me a hint?

Thanks in advanced,

Wim

Comments

quicksketch’s picture

Title: webforms module and %server[] » Dynamic redirect using %server[]

Let me prefix this by saying you're really pushing the limits of what Webform should be used for. That's okay, just keep in mind that as versions of Webform change things like this might eventually break (especially between 1.x and 2.x versions).

What I'd recommend is downloading the 2.0 beta 1 version, which is more flexible in the allowed code in the Additional Processing box and using the following code:

// Redirect to Google when done.
$node->webform['confirmation'] = 'http://google.com';

// Redirect to the contents of a hidden field.
$node->webform['confirmation'] = $form_values['submitted_tree']['my_hidden_value'];
quicksketch’s picture

Status: Active » Closed (fixed)

Closing.

I also documented this particular snippet in the Webform documentation: http://drupal.org/handbook/modules/webform