Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hi everybody,
do you know how can i change the weight (position) of the captcha element in my form.
For example I'd like to set one of my form field below the captcha element .
Thanks for the Help!!!!
Comments
Comment #1
soxofaan CreditAttribution: soxofaan commentedThis will probably help you further:
#743056: Document how to add a CAPTCHA programmatically
Comment #3
klikissy CreditAttribution: klikissy commentedIt doesn't seem to work...
Comment #4
pooja.sarvaiye CreditAttribution: pooja.sarvaiye commented@klikissy: in which form are you trying to reorder the Captcha field? Is it some form provided by drupal core or any module or a programmatically created form?
Comment #5
wundo CreditAttribution: wundo commentedComment #6
eugene.ilyin CreditAttribution: eugene.ilyin commentedComment #7
artemln CreditAttribution: artemln commentedIn dev branch 7.x-1.x the problem can not be reproduced.
You can change "#weight" from any form_alter. Simple example for the "registration form":
Also you can define the "captcha" between fields in your custom form. Simple example: