Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
It would be great if captcha images could always appear above the Send/Submit button! For example on my sitewide contact form the captcha image is below the button and thats really ugly (Look at the screenshot)! I dont think this is a feature request, but a must have for captcha.module.
Comment | File | Size | Author |
---|---|---|---|
captcha.png | 4.38 KB | profix898 |
Comments
Comment #1
sachinwfs CreditAttribution: sachinwfs commentedso i haven't yet figured out how to move the captcha around the contact form (even if you just use the mathematical captcha it's placement is all screwed), but i have figured out a way to make it look a bit prettier:
in captcha.module:
add this line either before or after the other $form definition:
$form['spacer'] = array('#value' => '<br /><br />';
this is definitely a kludge, mainly because i'm not at all familiar with either drupal or php but it seems to work.
as far as moving it to above the submit button, i suspect it has something to do with weights. i'm going to work on it some more (it bothers me too!) and i'll post here if i make any more progress.
Comment #2
sachinwfs CreditAttribution: sachinwfs commentedyikes, typo. try this instead:
$form['spacer'] = array('#value' => '<br /><br />');
(there is now a closing parenthesis before the semi-colon)
Comment #3
profix898 CreditAttribution: profix898 commentedI use some code like this
to control the position the form item is inserted at.
(Adjust the '5' to an appropriate value.)
I think the $captcha_points array could be easily extended to contain
not only the form_name but also a position for inserting captchas.
For example ...
I havent looked at the implementation in captcha.module, but
it shouldnt be hard to modify the source accordingly.
Comment #4
profix898 CreditAttribution: profix898 commentedUpps. Sorry!
$form['myformitem']['text'] ...
must be$form_insert['myformitem']['text']
of course.Comment #5
stf@drupal.org CreditAttribution: stf@drupal.org commentedWouldn't the simplest way be to just adjust the weight?
in
just change it appropriately in line 144
(talking about cvs-version 2006/11/02)
unless you have already redefined weights in the contact form,
this makes the challenge appear below the submit button.
Comment #6
Matt BWe want the challenge to appear above the send / submit button - not below it. Why does this only affect the contact form and not the user registration form?
Does changing the weight in captcha_captchachallenge affect the use of textimage as well?
Comment #7
Matt BI made this change to textimage.module (to the textimage_captchachallenge function on line 19). This moves the captcha textimage to just above the submit button:
It works on my implementation, on the contact form and the user registration form and I have not needed to test it on other forms. (I've also changed the wording of the alternative text for the image in my version of the function as the original is not user friendly)
Matt
Comment #8
wundo CreditAttribution: wundo commented