i've just scoured the forums and the code itself and i'm wondering how i can reposition captcha on the contact form in particular. In particular, i'd like it to go ABOVE the submit button (others have posted about this on the forum but no answers)
i can hack the module and use 'weight' to make captcha go either way up on top of the form (default which looks poor) or all the way below the submit button at the form bottom (looks better but not ideal). i want it above the submit button.
This mostly involves inserting the captcha textfield element in the form correctly
i see the module implements form_alter (captcha_form_alter).. so it appears that that is the location where the repositioning should take place.
if this was a simple form, i think i could handle it. But because there are actually two Submits applied to the same form (i think?... one for the captcha and one to actually process the mail form). when i look at this function, it doesn't make sense to me. It also uses a function "call_user_func_array" and i can't find it in the api reference.
Can anyone either post the code or the way to fix this.
Ideally it would be customizeable in some way in the admin or overriding a function so the module doesn't have to be hacked.
I (and others) would probably really appreciate this.
thanks for any help anyone can provide
| Comment | File | Size | Author |
|---|---|---|---|
| #8 | captchaweight.patch | 1.66 KB | robloach |
| #1 | submit_last.patch | 502 bytes | thesaint_02 |
Comments
Comment #1
thesaint_02 commentedThe captcha field below the submit button bothered me too and I have changed the captcha code to change this. I have attached a patch.
Comment #2
DiGiT commentedThanks archangel, this patch works also for me. I'm using drupal 5.1 and applied the patch manually to the 'captcha.module,v 1.32 2007/01/30 19:44:46' captcha module.
Comment #3
jadams1-1 commentedI have 2 'categories' in my registration form and the captcha apprears after the second one. Basically shows up in the middle of the registration form. It is on a 5.1 system.
Comment #4
jadams1-1 commentedSorry, the previous comment should read " I have 3 categories ...". Thanks
Comment #5
wundo commentedIf it's a 5.1 system, you should use HEAD version, not 4.7.
Comment #6
jadams1-1 commentedI was using the 5.1 dev version. I tried the HEAD version and got a blank page. Apache error log says:
[error] [client 192.168.0.11] PHP Fatal error: Cannot use string offset as an array in /var/www/html/sites/default/modules/captcha/captcha.module on line 166, referer: http://192.168.0.10/
Thanks
Comment #7
ednique commentedI use 4.7.6 and had the same problem.
Most Captcha's appeared after the submit button...
And I fixed it, but I've done it in the textimage module in the textimage_captchachallenge function:
I hope this helps you out...
Comment #8
robloachThe attached is a patch to make it so that you can set the weight of the Captcha form in admin/settings/captcha . All dependant captcha modules have to use
variable_get('captcha_weight', 0)for the #weight value when creating the form.Comment #9
heine commentedFAPI has a weight type, which saves you code.
Setting a weight for all forms is not the solution. Not all submit buttons have the same weight. Some have no weight at all.
Comment #10
wundo commented