문제

I am using the webform module for Drupal 6 and would like to set a default value for the confirmation message of the webform whenever it is created. Would I have to create my own module to set this form value whenever a user creates a new webform? Or would I have to implement a special hook to look for when a webform is created?

도움이 되었습니까?

해결책

You going to want to use the following:

customMod_form_alter(&$form, $form_state, $form_id){ 
  if($form_id == 'webform_node_form'){ 
    $form['id_of_conf_message_field']['#default_value'] = 'BLAH BLAH'
  }
}

다른 팁

@esafwan .. I'm not sure whether this shall help in your case with the hidden fields issue but I found this link for default variable values http://drupal.org/node/296453 so I was able to create a hidden field in my already existent webform with default value %request[key] and worked perfectly ..

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top