I have a situation I want to put (*) instead of "required" word inside the place holder of a webform field is it possible from webform admin.

  • Which version of webform module you are using ? – Rupesh Jun 30 '14 at 7:12
  • version 7.x-3.19 – madhurjya Jun 30 '14 at 7:28

You can add this (*) in field label with field name or can use with style also.


You can always write a hook_preprocees_HOOK in your theme's template.php, in this case it would be

function THEME_preprocess_field(&$variables) {
   if ($element['#field_name'] == 'field_YOURFIELD' && $element['#bundle'] == 'webform' && $element['#view_mode'] == 'full') {
    $variables['theme_hook_suggestions'][] = 'field__field_WEBFORM_MY_TPL';
    $variables['ANOTHER VARIABLE_TO_OUTPUT'] = 'preprocessed';

where you can manipulate the vars for this field, or even set your own template by copying the field tpl to your needs

  • So nice, you mean to say that there is no other option instead of using preprocess. – madhurjya Jun 30 '14 at 9:10
  • Hmm, no i don't say it's the only option.It is just the best option if you like to have everything controlled in your own code in a Drupal standards way. – Pan Chrono Jun 30 '14 at 9:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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