I have some forms created with the Drupal 7 core poll-module.
On these forms the captcha placement is beneath the vote button instead of above, see picture.

I hope you can help me to fix this.


captcha.png22.05 KBeverkuil
Members fund testing for the Drupal project. Drupal Association Learn more


AlexandrShalbetskiy’s picture

Status: Active » Needs review

Hi, Erik.

In your theme template.php add new preprocess function.

function THEME_NAME_preprocess_poll_vote(&$variables) {
  $form = $variables['form'];
  $variables['choice'] = drupal_render($form['choice']);
  $variables['title'] = check_plain($form['#node']->title);
  $variables['vote'] = drupal_render($form['captcha']);
  $variables['vote'] .= drupal_render($form['vote']);
  $variables['rest'] = drupal_render_children($form);
  $variables['block'] = $form['#block'];
  if ($variables['block']) {
    $variables['theme_hook_suggestions'][] = 'poll_vote__block';

Because poll module, render all children after submit button.

everkuil’s picture

Dear Alexander,

Your answer did the tric, thanks a lot.


soxofaan’s picture

Category: bug » support
Status: Needs review » Active