captcha shows up after submit button
Anonymous — Mon, 11/06/2007 - 00:08
Another issue with the drupal contact form.
The catpcha image and input field show up after the "Send e-mail" button.
- Login to post comments
Anonymous — Mon, 11/06/2007 - 00:08
Another issue with the drupal contact form.
The catpcha image and input field show up after the "Send e-mail" button.
Sleep better after a security review.
Duplicate of
Heine — Mon, 11/06/2007 - 07:22Duplicate of http://heine.familiedeelstra.com/node/37.
The issue here is that the contact form submit button doesn't have a weight. It is clear that MyCaptcha needs to solve this a bit more intelligently.
In the mean time you can fix Captcha appearance on the contact form in your theme: Create or add to the file template.php (minus <?php ?> tags):
$button = drupal_render($form['submit']);
return drupal_render($form) . $button;
}
Works great!
colorado — Mon, 11/06/2007 - 12:11Thank you so much - this fix works!
I just added more instances of that code for the other MyCaptchas on my sites (i.e. I have the Postcard module on one of my sites), changing contact_mail_page to the name of the form (i.e. postcard_create_form).
Another example
Heine — Wed, 20/06/2007 - 22:50You are welcome.
Some forms need a slightly different treatment as their submit button is named differently (internally). This is the case for guestbook for example:
//function theme_guestbook_form_entry_form($form) {
$output = '';
$access = $form['access']['#value'];
$display = $form['display']['#value'];
$uid = $form['uid']['#value'];
switch ($access) {
case 'allowed':
if ($display == 'link') {
// output only a link to a page with the form
$output .= '<p>» '. l(t('Add guestbook entry'), "guestbook/$uid/form") .'</p>';
}
else {
$output .= $display == 'page' ? '' : '<h3>'. t('Add guestbook entry') .'</h3>';
// CHANGED:
$button = drupal_render($form['send']);
$output .= drupal_render($form) . $button;
}
break;
case 'own guestbook':
$output .= ' ';
break;
case 'not logged in':
$output .= '<p class="links">» '. t('You must be logged in to post a comment.') .'</p>';
break;
case 'not allowed':
$output .= '<p class="links">» '. t('You are not allowed to post in this guestbook.') .'</p>';
break;
}
return $output;
}
into documention you go!
drozzy (not verified) — Wed, 21/05/2008 - 20:43This neat trick should really be mentioned in the documentation!
This is the second time I stumble across this (first time I didn't solve it :-)
Great module!