How to set a $_POST var value as default value for a textfield webform component? I need to set a $_POST variable value as the default value for a textfield webform component using Webform 4
In the Default Value field I filled with %post[my$_PostVar] but is not working.
update: it seems like Webform 4 lost the %get and %post tokens comment-6337368
any thoughts...
@googletorp
I installed the Availability Calendars module. This module shows a availability calendar and provide a formlet to allows the visitor to submit a booking.
When this form (the formlet) is submitted this is sent to a webform where the visitor will continue filling the personal data to complete the booking.
Then form let send these vars: $_POST['arrival_date'] and $_POST['departure_date']  to the Webform. Here is why I need to fetch these $_post values in the Webform components

Booking integration by providing a small &quot;formlet&quot; that can post to
(e.g.) a Webform.

and here some part of the Readme file of the module:

Defining the 'complete booking form' webform
-------------------------------------------- This part assumes you are using the webform module.

Define the webform components that the visitor should complete like name,   e-mail, address, number of persons, etc.

Define webform components for the dates that are already filled in:

Begin date (default value: %post[from_display]): the begin date.

End date (default value: %post[to_display]): the end date.
Webform 4 no longer uses so much of its own custom code.

It now uses drupal tokens like you would expect anywhere else.

Under the text area is a link "Browse available tokens." that will give you a javascript token browser to help you find the tokens you want.

You can access submission tokens like this: [submission:values:FIELD_KEY]

The special tokens you are after though like %post are no longer supported in webform 4.x.

For more information see https://www.drupal.org/node/1001798

Your best bet for such token support would be for them to be added to the main token module or another third party token module in the global token space.

$_GET tokens have an issue https://www.drupal.org/node/550164 however I don't think there is one for $_POST at this stage.

Alternatively you can write a hook_form_alter() in a custom module and set the default value there using $_POST.
That would be your easiest option I would say.