I've done a little research about usage of captcha in well-known web sites like Google, Yahoo and others. In most cases captcha is placed above the submit button or textarea. And this position also seems to be right for me. This is why I decided to make an improvement of captacha module.
I've already seen previous posts about captcha's position:
http://drupal.org/node/60874
http://drupal.org/node/103941
But patches and ideas there look strange for me. While I investigating the issue I've found that Drupal's forms haven't strict order(read: proper weight) and some forms like contact forms in generally hasn't weight field. So we couldn't add weight support to any field because we haven't standard of field's weight in Drupal. For example we could recommend to developers always to use weight=30 for submit button and weight=20 for textarea. It will allows to use such strict order in modules which push additional fields in Drupal's form.
Here I've posted very clear and simple patch which allows always to use the captcha filed above the submit button. I just get the weight of submit filed and decrease it by 1 for captcha's filed. And if the weight of submit field is absent when I create it with value 30.
| Comment | File | Size | Author |
|---|---|---|---|
| captcha_8.patch | 806 bytes | Anonymous (not verified) |
Comments
Comment #1
charly commentedThanks!
note: These changes can be made to textimage/captcha.inc for image captcha.
Regards,
Comment #2
Anonymous (not verified) commentedyes, but i usually use text captcha.
Comment #3
archetwist commentedThanks for the patch. It does not work as intended when the comment preview option is enabled though. Here is my modified version:
Comment #4
robloachHow To RePosition Captcha is a duplicate issue. I submitted a patch to it that allows you to change the weight of the Captcha form that's presented in any form.
Comment #5
wundo commentedComment #6
archetwist commented