Hi, I'm running into a question about how elements created in hook_form_alter() can get submitted through with a Remote Post handler.
I may be doing something wrong, but I can't seem to find he right information needed and could use some validation about the approach.
I have a custom module that looks like:
function CUSTOM_MODULE_form_alter(&$form, $form_state, $form_id) {
$form['ReferralPath'] = array(
'#type' => 'hidden',
'#title' => 'ReferralPath',
'#name' => 'ReferralPath',
'#id' => 'ReferralPath',
'#value' => $_SERVER['HTTP_REFERER']
}
This is creating the form elements. When I go to the remote post handler, I don't see an option to send this field information through with the rest of my field data.
Any help would be greatly appreciated.
Comments
Comment #2
jrockowitz commentedYou must first create the webform element and then populate it via hook_form_alter or use a token. (@see #2021969: Provide a token for [current-page:referrer])