0

I have tried: Mollom module and Captcha module to put a captcha in my webforms.

Had no problem at all -they work for non-admin users- but they don't fit all my needs because I need an actual field I can include in a form in a position I want (e.g. my webform has two columns and want to place that field inside of one of the columns, instead of adding it at the end). E.g.

++++++++++++++++++++++++++++++++++++++++++++++++++++
+ First name              + Car Model              +
++++++++++++++++++++++++++++++++++++++++++++++++++++
+ Last Name               + Car Color              +
++++++++++++++++++++++++++++++++++++++++++++++++++++
+ City                    + I need captcha         +
+++++++++++++++++++++++++++ in this exact          +
+ Phone                   + line / cell            +
++++++++++++++++++++++++++++++++++++++++++++++++++++
+ T&C / ToU               +          Send          +
++++++++++++++++++++++++++++++++++++++++++++++++++++

But with those modules I get the captcha field as displayed:

++++++++++++++++++++++++++++++++++++++++++++++++++++
+ First name              + Car Model              +
++++++++++++++++++++++++++++++++++++++++++++++++++++
+ Last Name               + Car Color              +
++++++++++++++++++++++++++++++++++++++++++++++++++++
+ City                    +          Send          +
++++++++++++++++++++++++++++++++++++++++++++++++++++
+ Phone                   +                        +
+++++++++++++++++++++++++++                        +
+ T&C / ToU               +                        +
++++++++++++++++++++++++++++++++++++++++++++++++++++
+ I'm having the                                   +
+ captcha component at                             +
+ the end of the form                              +
++++++++++++++++++++++++++++++++++++++++++++++++++++

(which does not help since the "send" button is above the field and the field is not inside of any column).

What module could I install so I can create an explicit [web]form captcha field and place it where I want in the form layout?

1

Maybe think about alternatives? We use BOTCHA module everywhere these days to combat spam submissions. Works much better than any captcha and is far less intrusive for real people. Just a thought.

0

I can think of a few ways to do this while still using the contrib catpcha or mollom modules.

First, you can use a hook_form_alter(), but you probably need to make sure that your module has a heavier weight than the captcha modules so that you can be sure to alter the form (and manipulate the #weight of the individual form elements) after all other modules have done their part.

A second, completely different way would be to create a custom theme function for this form.

I have done both approaches (depending on the needs of the project) and they both work.

As far as I am aware, there is no module that explicitly helps with the layout of captcha fields within a form.

0

Use hook_form_alter and form api weight attribute of form element to handle this situation.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.