I'm trying to create a webform in Drupal 6 where the label of a select webform component is rendered using the contents of a variable. For example:

client_name = "Starbucks"

and I would like the label of 5 or 5 different webform components to include "Starbucks". I prefer to code this with a variable, as this webform will be cloned in the future.

Is there a way to do this? From what I can tell, labels do not accept Drupal tokens and I'm not sure where to define the variable.

any help is appreciated!

1 Answer 1


You can alter form elements, including labels with hook_form_alter(). Use dpm() (from the Devel module) to inspect the $form array to find the value you want to change.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.