I put the code below that I happened to find on another site to template.php in garland theme but it doesn't work.
Anybody has successfully moved the help texts after(below) labels?

function garland_form_element($element, $value) {
$output = '<div class="form-item"';
if (!empty($element['#id'])) {
$output .= ' id="'. $element['#id'] .'-wrapper"';
}
$output .= ">n";
$required = !empty($element['#required']) ? '<span class="form-required" title="'. t('This field is required.') .'">*</span>' : '';


if (!empty($element['#title'])) {
$title = $element['#title'];
if (!empty($element['#id'])) {
$output .= ' <label for="'. $element['#id'] .'">'. t('!title: !required', array('!title' => filter_xss_admin($title), '!required' => $required)) ."</label>n";
}
else {
$output .= ' <label>'. t('!title: !required', array('!title' => filter_xss_admin($title), '!required' => $required)) ."</label>n";
}
}
if (!empty($element['#description'])) {
$output .= ' <div class="description">'. $element['#description'] ."</div>n";
}
$output .= " $valuen";

$output .= "</div>n";

return $output;
}

Comments

DonnyCarette’s picture

Try the following code and clear your cache after adding this to your template.php
(If you are using another theme, change 'garland' to your theme name in the function

function garland_form_element($element, $value) {
  $output = '<div class="form-item"';
  if (!empty($element['#id'])) {
    $output .= ' id="'. $element['#id'] .'-wrapper"';
  }
  $output .= ">";
  $required = !empty($element['#required']) ? '<span class="form-required" title="'. t('This field is required.') .'">*</span>' : '';
  
  
  if (!empty($element['#title'])) {
    $title = $element['#title'];
    if (!empty($element['#id'])) {
      $output .= ' <label for="'. $element['#id'] .'">'. t('!title: !required', array('!title' => filter_xss_admin($title), '!required' => $required)) ."</label>";
    }
    else {
      $output .= ' <label>'. t('!title: !required', array('!title' => filter_xss_admin($title), '!required' => $required)) ."</label>";
    }
  }
  if (!empty($element['#description'])) {
    $output .= ' <div class="description">'. $element['#description'] ."</div>";
  }
  $output .= $value;
  $output .= "</div>";
  return $output;
}
chinita7’s picture

I just tried it and worked. Thanks!

zeta1600’s picture

How about for D7?