Created
August 29, 2013 08:15
-
-
Save rubedell/6375470 to your computer and use it in GitHub Desktop.
Webform block - copy node title to hidden field
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function the_aim_custom_form_alter(&$form, &$form_state, $form_id) { | |
switch ($form_id) { | |
//apply for job form | |
case 'webform_client_form_38': | |
//get title of current node and insert into webform field | |
$current_object = menu_get_object(); | |
if(isset($current_object->title)) { | |
$job_title = $current_object->title; | |
$form['submitted']['vacature']['#default_value'] = $job_title; | |
} | |
break; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment